-
-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(core) - Deprecate the "operationName" property and move to "kind" #1045
Conversation
🦋 Changeset detectedLatest commit: 41bc6c8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work Brandon!
Let's figure out when we want to release this 🤔 I don't expect anyone to have any major issues with this change, since it won't be breaking unless someone does something absolutely weird, but it's worth double checking. |
Update: I loaded the sandbox as a quick smoke test and it all seems to work fine but it is triggering the warning, which is odd. https://codesandbox.io/s/urql-issue-template-client-forked-nsrde |
The addMetadata utility was definitely kept in the wrong place since it concerns operations. `makeOperation` has been updated to fill out the context if it isn't passed which may become convenient in a couple of places, instead setting it to the `operation.context`.
f452a19
to
41bc6c8
Compare
Resolves #1005
Summary
It's currently tricky to differentiate between the urql-specific
Operation.operationName
property, and the more generalOperationDefinitionNode.name.value
property. This PR deprecates the "operationName" property in favor of "kind", issues a warning the first time the deprecated property is accessed, and updates all exchanges.Set of changes
packages/core/src/utils/deprecation.ts
- a utility for issuing deprecation warnings only once.packages/core/src/utils/operation.ts
withmakeOperation
- a utility for creating Operation objects with a getter/setter for theoperationName
property that issues a deprecation warning.packages/core/src/client.ts
to usemakeOperation
and move property references from "operationName" to "kind".cache
,dedup
,fallback
,fetch
,ssr
, andsubscription
exchanges to move references from "operationName" to "kind".exchanges
packages.