You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried to spin up a relay client with rejoiner-based GraphQL server on the back end and here are my observations:
relay client requires graphql.schema to be available locally. So GrapQL server needs to expose a way to get a schema. This is as simple as using schema printer and exposing it via /schema endpoint.
My need to update an example to demo complete integration. private static final String schema = new SchemaPrinter().print(SCHEMA);
I feel a bit uneasy about the fact that ID fields annotations belong to actual source .proto files. I actually have not tested it and not sure if it works properly given that Relay support is experimental.
It could use some more centralized config. For example assume all fields with name id are actually an GraphQL ID type and provide a way to turn it off and/or provide a different name for an ID field. For example new SchemaProviderModule(uid). Since there is a way to update the types on case-by-case basis, I feel this might have a better separation of concerns than to actually bake relay-related artifacts into .proto files.
Similarly I feel that relay support is awesome in general, but should be optional. Maybe it can be an an option to the SchemaProviderModule(relay: true).
I haven't tested @RelayNode signature, but I like the idea.
I haven't checked if mutations and connections work as per spec but planning to get to it soon.
I have tried to spin up a relay client with rejoiner-based GraphQL server on the back end and here are my observations:
relay client requires
graphql.schemato be available locally. So GrapQL server needs to expose a way to get a schema. This is as simple as using schema printer and exposing it via/schemaendpoint.My need to update an example to demo complete integration.
private static final String schema = new SchemaPrinter().print(SCHEMA);I feel a bit uneasy about the fact that
IDfields annotations belong to actual source.protofiles.I actually have not tested it and not sure if it works properly given that Relay support is experimental.
It could use some more centralized config. For example assume all fields with name
idare actually an GraphQLIDtype and provide a way to turn it off and/or provide a different name for an ID field. For examplenew SchemaProviderModule(uid). Since there is a way to update the types on case-by-case basis, I feel this might have a better separation of concerns than to actually bake relay-related artifacts into .proto files.Similarly I feel that relay support is awesome in general, but should be optional. Maybe it can be an an option to the
SchemaProviderModule(relay: true).I haven't tested
@RelayNodesignature, but I like the idea.I haven't checked if mutations and connections work as per spec but planning to get to it soon.