Skip to content

I want to replace the contents of resolve with another function. #902

Answered by hayes
touyu asked this question in Q&A
Discussion options

You must be logged in to vote

There isn't a a perfect solution here, but there are a few options.

I personally tend to use the singular builder.qyeryField when I want to isolate the resolver for one field. This is the easiest option, but doesn't always work.

If you want to create something reusable that takes just some of the args, you can use utils like: #735

This allows you to get the types of input objects without redefining everything. Just a heads up here, the generic type signature of refs will change slightly in 4.0

If you want the full args types, you probably need to hoist your args out of the field definitions. You can use const YourArgs = builder.args(t => ({argName: t.string() })) to build an args object a…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@touyu
Comment options

@hayes
Comment options

Answer selected by touyu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants