Replies: 3 comments 3 replies
-
Hey, thanks for the detailed question and sorry about the trouble. For syncing, I think the
(Swap Then, I the client will need to include a version header along with the Want to give those a try? Let me know what you think! |
Beta Was this translation helpful? Give feedback.
-
First I ran into an issue with the CLI app:
Turns out if I add another Anyway, adding the header didn't work. I don't understand how it would. The operation sync endpoint doesn't know what header we use to specify the changeset version. The only place we currently have any reference to it is in our main GraphQL controller where we're doing something like Isn't the issue with sync with |
Beta Was this translation helpful? Give feedback.
-
Well, derp! Sorry about all the hiccups on that. Now I see what you mean about the OperationStore endpoint needing an update to receive that header. Let me work up some fixes in the JS library and in GraphQL-Pro, then I'll post an update back here. |
Beta Was this translation helpful? Give feedback.
-
We recently started using changesets in our schema for handling breaking changes. One such example is changing a field's return type from a simple array of objects to a paginated list. It works well.
Now, we're trying to get the operation store setup and syncing queries from a client app. Only one query fails to sync, and that's the query that depends on a changeset being activated.
I can certainly understand why this would be the case since the operation store doesn't know what changeset version the client is using and can't make any assumptions. The query expects the field to be a connection type, but the engine thinks it's still the old array type.
I'm guessing the problem comes from
GraphQL::Pro::OperationStore::Validate
not settingchangeset_version
in the context when validating the query.Setting the changeset version there would probably fix the validation problem and might even allow the query to be stored. The next question is: what about execution? I guess that might work if the client continues to send the changeset version with each request (e.g. send query hash + changeset version), but I don't think that would make the most sense since the stored queries are only compatible with the changeset version they were designed for and the server would know the changeset version at sync time if the client included that value.
If my assumptions are correct so far, I imagine one solution might be:
graphql-ruby-client
for the schema version, allowing the client to tell the server what version the queries were designed with.graphql_operations
for the changeset version. Store the changeset version that the client passed with the sync operation.Sidenote: the changeset version might need to groomed/validated before storage. For example if the latest changeset is
2023-01-09
but the client is using a value of2023-01-22
, the actual changeset version that's being applied is2023-01-09
and the value they sent doesn't exist.Beta Was this translation helpful? Give feedback.
All reactions