-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can params be used in sub trees of a query? #71
Comments
I just realised that the gql can be written as a function:
Would this be the preferred way of doing it? |
Hi @victorbadila , thank you for your interest in this library!
I never tried that way, but it looks working well and seems the only solution if the following code does not work: const categoryQuery = params({ $id: 'Int!', $pageSize: 'Int!', $currentPage: 'Int!' }, {
category: params({ id: '$id' }, {
id: types.number,
description: types.string,
// ...
}),
products: params({ pageSize: '$currentPage' }, {
items: {
id: types.number,
// etc.
},
}),
}); Have you tried that? I believe it works. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suppose I have a gql query that looks like this:
Is there any way I could write it using this library? I am able to do so for the individual
category
andproduct
queries, but I wasn't able to do this for the full example, where params int he query are passed down in different trees.The text was updated successfully, but these errors were encountered: