graphql-gun icon indicating copy to clipboard operation
graphql-gun copied to clipboard

Feature request: custom resolvers / advanced querying

Open brysgo opened this issue 4 years ago • 5 comments

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:

  1. Write an option to pass in resolvers that has a function to dynamically determine the type

or

  1. 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.

brysgo avatar Jul 16 '20 12:07 brysgo

@ivanmhale - this one is for you

brysgo avatar Jul 17 '20 00:07 brysgo

@brysgo Is there any update on this issue?

ansarizafar avatar Jul 27 '21 10:07 ansarizafar

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.

brysgo avatar Jul 27 '21 11:07 brysgo

I am just a beginner, so I don't know how to do it.

ansarizafar avatar Jul 27 '21 13:07 ansarizafar

@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

zcaudate avatar Aug 13 '21 14:08 zcaudate