NavidK0 / SimpleGraphQL-For-Unity

A simple graphQL client that allows one to use .graphql files (or code) for queries, mutations, and subscriptions with Unity.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subscriptions not found using FindQuery (if placed together wit other graphql statements)

Sewdn opened this issue · comments

Subscription queries need to be placed in a separate .graphql file, so they can be be referenced by only using the filename when using FindQuery (since other parameters don't seem to be working for subscriptions).

This is an easy workaround, but still can give some headaches when following documentation.

SimpleGraphQL doesn't do anything special to separate queries, so it seems like this is a server-side thing. However, I tested on various servers with queries and subscriptions in the same file, and the behavior varies quite a bit.

I will change up the documentation a bit to recommend putting subscriptions in a different file. We don't do any special parsing to separate queries in files. Instead, we use the "operationName" parameter provided by the GraphQL protocol.

Should be updated with c2d9e1a. Thank you for bringing this up!