Skip to content

Update operation normalization to deterministically sort fragments.#1158

Merged
abernix merged 2 commits intomasterfrom
abernix/op-reg-backport
Apr 2, 2019
Merged

Update operation normalization to deterministically sort fragments.#1158
abernix merged 2 commits intomasterfrom
abernix/op-reg-backport

Conversation

@abernix
Copy link
Copy Markdown
Member

@abernix abernix commented Apr 1, 2019

This re-lands the work from #1027, #1115 and #1118, which first surfaced in
an apollo@next CLI version via #1113 which was released in order to provide a
migration path for customers of Apollo Engine plans which support the operation registry who utilize the CLI's apollo client:push features.

Those customers were notified and advised to either pin their apollo
version prior to this being released, so the hope is that we'll be able to
released this under the apollo@2 cover without incurring breaking changes
on anyone else.

That said, if you find yourself in a predicament that links back to this PR, we suggest re-registering all operations using the new version of the apollo client:push command available in this version and, once all client operations are re-registered, upgrade the apollo-server-plugin-operation-registry to 0.1.0-alpha.1.

Copy link
Copy Markdown
Contributor

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes LGTM @abernix, thanks for putting this PR together! I've rebased against master (which seems to have removed any notion of a publish ever happening on another branch 👍) and added a fix to the generated types (which could be squashed into the commit before it).

I'll leave this for you to merge or give a final LGTM before we merge/publish, but good to go as far as I'm concerned.

@trevor-scheer trevor-scheer force-pushed the abernix/op-reg-backport branch from 2192b9f to 67cd0d0 Compare April 2, 2019 00:14
@abernix abernix force-pushed the abernix/op-reg-backport branch from 67cd0d0 to e420e8e Compare April 2, 2019 15:24
abernix added a commit that referenced this pull request Apr 2, 2019
@abernix abernix force-pushed the abernix/op-reg-backport branch from 2255c74 to 7213bcc Compare April 2, 2019 15:35
This includes the work from #1027, #1115 and #1118, which first surfaced in
an `apollo@next` CLI version which was released in order to provide a
migration path for paying customers who utilize the Apollo Operation
Registry through the CLI's `apollo client:push` features.

Those customers were notified and advised to either pin their `apollo`
version prior to this being released, so the hope is that we'll be able to
released this under the `apollo@2` cover without incurring breaking changes
on anyone else.

For more information on the operation registry, see:

https://www.apollographql.com/docs/platform/operation-registry.html

And if you encounter any problems, please contact our customer support via
Intercom from within your Engine UI.

---

The summary of the relevant commit messages is below:

1) Remove duplication from client:push and client:extract.
2) Create a test to verify upcoming changes for this PR.

Cutover to apollo-graphql

* Add apollo-graphql as a dependency (and project reference)
* Remove apollo-engine-reporting as a dependency
* Update sortAST to normalize order of fragments w.r.t operations
* Tests are failing expectedly at this point

Centralize operation hashing function

These two operations will likely be used in tandem, and we want this to be consistent across consumers.

Incorporate rename suggestions

Update version for extracted manifest output.

Use empty string and add comment about unused metadata field.

Revert changes to defaultEngineReportingSignature. Apply changes to new function, defaultOperationRegistrySignature.

This new function is the effective interim fix, and the current existing function is now left alone.

Pass operation name along to the operation registry signature function

Leverage updated registerOperations API

Now that registerOperations supports version as an argument
to the mutation, we can leverage this for v2 oeprations manifest
work.
@abernix abernix force-pushed the abernix/op-reg-backport branch from 7213bcc to ea54115 Compare April 2, 2019 15:36
@abernix abernix changed the title Operation Registry updates for apollo@2. Update operation normalization to deterministically sort fragments. Apr 2, 2019
@abernix abernix merged commit dd662a5 into master Apr 2, 2019
@abernix abernix deleted the abernix/op-reg-backport branch April 2, 2019 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants