Skip to content

disable automatic __typename selection and fix client runtime errors connected to it#773

Merged
nalchevanidze merged 16 commits intomainfrom
disable-atotamatic-typename-selection
Oct 18, 2022
Merged

disable automatic __typename selection and fix client runtime errors connected to it#773
nalchevanidze merged 16 commits intomainfrom
disable-atotamatic-typename-selection

Conversation

@nalchevanidze
Copy link
Copy Markdown
Member

@nalchevanidze nalchevanidze commented Oct 18, 2022

  • GQL app does not automatically insert __typename field on union selections
  • GQL client does not generates only the datatypes for casted union types +1 type for fallback
  • not selecting __typename on clients does not causes runtime error, however client will decode it as fallback type
  • if you forgot to select __typename on unions, morpheus client will warn you about it.

fixes #687
fixes #509

@nalchevanidze nalchevanidze marked this pull request as ready for review October 18, 2022 19:26
@nalchevanidze nalchevanidze added 📦 client Label for affected Package: "morpheus-graphql-client" pr/breaking Breaking Change labels Oct 18, 2022
@nalchevanidze nalchevanidze changed the title disable automatic type name generation disable automatic __typename selection and fix client runtime errors connected to it Oct 18, 2022
@nalchevanidze nalchevanidze merged commit a5ca49f into main Oct 18, 2022
@nalchevanidze nalchevanidze deleted the disable-atotamatic-typename-selection branch October 18, 2022 19:57
@github-actions github-actions bot mentioned this pull request Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 client Label for affected Package: "morpheus-graphql-client" pr/breaking Breaking Change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Morpheus inserts __typename to disambiguate unions. Unexpected '__typename not found on object'

1 participant