crystal icon indicating copy to clipboard operation
crystal copied to clipboard

GraphiQL Explorer doesn’t support lists

Open geraldurbas opened this issue 1 year ago • 2 comments

Dear Graphile Team,

I stumbled upon the following behavior in an inherited project. That doesn't seem directly logical to me. In any case, the whole thing is already very cool and, as promised, super fast. thanks!

3 Queries - quite self explaining. That's not how it do not work as expected:

query MyQueryfails {
  files(
    filter: {or: {mimeType: {like: "%png%"}, or: {mimeType: {like: "%jpeg%"}}}}
  ) {
    nodes {
      codec
      bitrate
      contentSize
      mimeType
    }
  }
}

Here's is how it works:

query MyQueryworks {
  files(
    filter: {or: [{mimeType: {like: "%png%"}},{mimeType: {like: "%jpeg%"}}]}
  ) {
    nodes {
      codec
      bitrate
      contentSize
      mimeType
    }
  }
}

so far so good

But why is it working again?

query WhyIstheQueryWorking {
  files(
    filter: {or: {contentSize: {greaterThan: 70000}, or: {contentSize: {lessThan: 80000}}}}
  ) {
    nodes {
      codec
      bitrate
      contentSize
	  mimeType
    }
  }
}

Finally, this beautiful automatically generated GUI also seems to have trouble with the array in the or option.

image

geraldurbas avatar Dec 18 '24 00:12 geraldurbas

Yeah this is an issue with graphiql explorer that is yet to be addressed:

https://github.com/OneGraph/graphiql-explorer/issues/32

As for why it works without a list:

https://spec.graphql.org/draft/#sec-List.Input-Coercion

benjie avatar Dec 18 '24 09:12 benjie

Yeah this is an issue with graphiql explorer that is yet to be addressed:

OneGraph/graphiql-explorer#32

As for why it works without a list:

https://spec.graphql.org/draft/#sec-List.Input-Coercion

Thanks for the reference link and fast response.

geraldurbas avatar Dec 21 '24 23:12 geraldurbas