async-graphql / async_graphql_apollo_studio_extension

Async GraphQL Apollo Extensions
MIT License
32 stars 7 forks source link

Extension sending invalid queries to Apollo studio #109

Open mattoni opened 2 years ago

mattoni commented 2 years ago

It appears that using fragment queries with this extension attaches an extra } to the end of the fragment portion when sending to Apollo Studio, causing parse errors for the vast majority of my queries. Here's an example of what I see in Apollo Studio:

image

And the query in question:

fragment missingCaps on MissingCapabilities {
  __typename
  message
  required
  oneof
}
fragment pilot on Pilot {
  id
  name
}

fragment catchAll on Error {
  __typename
  message
}
query pilotList {
  operatorList(role: ROLE_PILOT) {
    ... on SpecificOperatorConnection {
      edges {
        node {
          __typename
          ...pilot
        }
        __typename
      }
      __typename
    }
    ...missingCaps
    ...catchAll
    __typename
  }
}

And what Apollo Studio sees:

fragment missingCaps on MissingCapabilities{ __typename message required oneof }} fragment pilot on Pilot{ id name }} fragment catchAll on Error{ __typename message }} query pilotList { operatorList(role: ROLE_PILOT) { ... on SpecificOperatorConnection { edges { node { __typename ... pilot } __typename } __typename } ... missingCaps ... catchAll __typename } }

Every fragment has a } added into it causing the issue.

Miaxos commented 2 years ago

I'll have time to fix it this week-end

mattoni commented 2 years ago

Any update on this?