Replies: 1 comment 1 reply
-
Unless I'm misunderstanding, you haven't implemented a connection in your sample query. The type you show is
which is a standard list. The connection syntax is different, you'll want to do something like this const getBookingsByIds: NexusExtendTypeDef<"Query"> = queryField((t) => {
t.connectionField("getBookingsByIds", {
type: BookingObject,
additionalArgs: { input: GetBookingsByIdsInput },
resolve(src, args) {
return Services.Booking.getBookingsByIds(args.input.bookingIds);
}
}
}); Couple things to note:
I hope that helps |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there nexus lads,
I'm just trying to understand the nexus docs for the connectionPlugin and just wanted some documentation clarification for us nexus noobs of using the connectionField or via the the connectionPlugin.d.ts types for infinite scroll both forward and backwards pagination. I'm using Apollo as well cheers.
It seems there are issues for using the connectionField 1.0.0 up so i'm trying to get some advice on alternative methods. Or am i missing something?
btw love the work from the nexus team.
Any help would be greatly appreciated.
This is an example below of what i have in the graphql.ts apollo server file and generic prisma nexus nexus-prisma setup currently (will upgrade nexus to remove GraphQLSchema casting soon) using a onion architecture
Here is the inital object
Here is the initial api query
here is an example of the repository call
Beta Was this translation helpful? Give feedback.
All reactions