-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat(diagnostics): validate up to date hash #301
Conversation
🦋 Changeset detectedLatest commit: c33a6b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@@ -247,6 +250,26 @@ export function getGraphQLDiagnostics( | |||
}; | |||
} | |||
|
|||
const hash = callExpression.arguments[0].getText().slice(1, -1); | |||
if (hash.startsWith('sha256:')) { | |||
const upToDateHash = `sha256:${generateHashForDocument( |
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.
This may compose into sha256:undefined
which then likely always issues the warning instead of bailing out
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.
we have basically evaluated all the pre-conditions for this not to happen though
Co-authored-by: Phil Pluckthun <[email protected]>
…GraphQLSP into add-validation-for-up-to-date-po
During diagnostics when we see a prefix of
sha256
we can assume that we generated the hash, this means we can verify whether it's up to date. This adds a warn diagnostic for persisted-operations and warns you when the hash is up to date with the document.