Skip to content

Creating a GraphQL fetcher for nanoquery #297

Closed Answered by dkzlv
Contresito asked this question in Q&A
Discussion options

You must be logged in to vote

Hey there, @Contresito!

It's generally up to you how you structure your fetcher functions. The way you did it works too, but I agree that looks a bit cumbersome, and may even have performance tax (more on that below).

Here's a demo of how I would approach that. The key takeaway is that I would not use the global fetcher function and instead define fetcher functions in every fetcher store individually. I would then define variables as keys, and just pass them into a generalized request function that fetches stuff from GQL endpoint. It's not too much of repetition, but it looks/behaves a bit better.

Feel free to ask more stuff. In general, if you have nanoquery-related questions, you should…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@Contresito
Comment options

@dkzlv
Comment options

@Contresito
Comment options

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