rafiki icon indicating copy to clipboard operation
rafiki copied to clipboard

Allow null in GraphQL response

Open wilsonianb opened this issue 2 years ago • 1 comments

Replace maybeValue with inputMaybeValue (available in newer versions of graphql-code-generator) to allow null in GraphQL responses. https://github.com/interledger/rafiki/blob/main/packages/backend/codegen.yml#L11

wilsonianb avatar Aug 09 '22 17:08 wilsonianb

This is also necessary to return null from a __resolveType resolver https://www.apollographql.com/docs/apollo-server/v2/schema/unions-interfaces/#resolving-a-union

wilsonianb avatar Aug 10 '22 16:08 wilsonianb

:confused: We appear to already be able to return null from resolvers. I even tried rebasing on:

  • https://github.com/interledger/rafiki/pull/921

wilsonianb avatar Jan 17 '23 22:01 wilsonianb

This is also necessary to return null from a __resolveType resolver https://www.apollographql.com/docs/apollo-server/v2/schema/unions-interfaces/#resolving-a-union

And we don't current have any unions in our schema

wilsonianb avatar Jan 17 '23 22:01 wilsonianb