apollo-kotlin icon indicating copy to clipboard operation
apollo-kotlin copied to clipboard

How to handle key which is present in graphqls but not available on server side?

Open wishygupta opened this issue 5 months ago • 1 comments

Question

In my mobile application on graphqls file I have few objects which will be added later on server side. If my try to run the code the app crashes since the server doesn't respond with those keys. How can I make those optional or ignore them?

wishygupta avatar Feb 21 '24 09:02 wishygupta

Are trying to query fields that your server does not support? If yes, there's no silver bullet there. You'll either have to edit your queries to remove those fields or edit your server to support them.

I can think of possible alternative workarounds (mockserver, interceptor) but it's hard to tell without more context. Can you share your query/crash?

martinbonnin avatar Feb 21 '24 10:02 martinbonnin

@wishygupta anything else we can help with here?

martinbonnin avatar Feb 28 '24 10:02 martinbonnin

Closing. Let us know if anything comes up

martinbonnin avatar Mar 12 '24 13:03 martinbonnin

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Kotlin usage and allow us to serve you better.

github-actions[bot] avatar Mar 12 '24 13:03 github-actions[bot]

Woops, I should have closed this one as "not planned" to avoid the message bot. Sotty about this @wishygupta but yes, if you have any feedback please leave it here or in the survey!

martinbonnin avatar Mar 12 '24 14:03 martinbonnin