graphql-gun
graphql-gun copied to clipboard
Feature request: custom resolvers / advanced querying
This is probably the most requested feature, basically people want to write resolvers like they do with graphql. There are two approaches to making this happen:
- Write an option to pass in resolvers that has a function to dynamically determine the type
or
- Switch from using forked graphql-anywhere to graphql-js
Option 2 would be a large undertaking and I'm not 100% sure how we would handle live queries, option 1 is much better to me, and if you are using typescript, we could default the dynamic type lookup to the typescript type.
@ivanmhale - this one is for you
@brysgo Is there any update on this issue?
I haven't heard anything, if you have the bandwidth and energy to make a push for new features I'd be happy to review them.
I am just a beginner, so I don't know how to do it.
@brysgo: I agree with what you are saying about the 2 ways of doing it. Basically option 1 involves breaking up the graphql query into pieces and then applying each piece to the data - which is doable if it's possible to somehow turn the graphql query into json format.
I asked here: https://github.com/amark/gun/issues/1115 but maybe you might know how the graphql parsing works