snowballdigital / flutter-graphql

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package. Built after react apollo
MIT License
47 stars 7 forks source link

Question: Purpose of "getOperationName" function #11

Closed thosakwe closed 5 years ago

thosakwe commented 5 years ago

While looking through the source of this package, I found this comment: https://github.com/snowballdigital/flutter-graphql/blob/master/lib/src/core/query_manager.dart#L67-L68:

// XXX there is a bug in the `graphql_parser` package, where this result might be
// null event though the operation name is present in the document

I am the creator/maintainer of the graphql_parser package. Can you provide some details about the bug you are referring to?

In a query like this:

{
  foo,
  bar: baz
  ...quux
  ... on A {b, c}
}

There is no operation name, and this a pretty common case.

Is it possible that the query you were using simply didn't have an operation name? Otherwise, if you can provide a repro, I can fix it.

juicycleff commented 5 years ago

Hi @thosakwe I didn't write that part of the code