tirumaraiselvan / graphql-engine

Blazing fast, instant realtime GraphQL APIs on Postgres with fine grained access control
https://hasura.io
Apache License 2.0
2 stars 0 forks source link

Research and probably reserve top level `extensions` field from remote #55

Open jberryman opened 5 years ago

jberryman commented 5 years ago

This came up here: https://github.com/hasura/graphql-engine/issues/2432

https://graphql.github.io/graphql-spec/June2018/#sec-Response-Format

The response map may also contain an entry with key extensions. This entry, if set, must have a map as its value. This entry is reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents.

It seems good to just union all of the extensions fields from remotes and (if any) from hasura. The only trouble obviously is when names overlap or the client needs to disambiguate extension responses from different remotes used in same query.

We could return our own extensions where we put remote extensions under separate namespaces. But that might entail rewriting clients which might defeat the purpose...

jberryman commented 5 years ago

Without a lot more information maybe the best approach is: