Skip to content
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

Remove error tooltip for populate directives #175

Merged
merged 2 commits into from
Apr 29, 2020

Conversation

imranolas
Copy link

Populate is a client side concept only and will throw an error when validated against the server side schema. This fix appends the populate directive to the client side schema to remove the error tooltips from any codemirror query panes.

@imranolas imranolas added the Bug Something isn't working label Apr 29, 2020
@@ -61,7 +62,9 @@ export const RequestProvider: FC = ({ children }) => {
debugEvent.type === "update" &&
isIntrospectionQuery(debugEvent.operation.query)
) {
setSchema(buildClientSchema(debugEvent.data.value));
setSchema(
appendPopulateDirective(buildClientSchema(debugEvent.data.value))
Copy link
Author

Choose a reason for hiding this comment

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

Apply the transform on incoming schemas

return extendSchema(schema, populateSchema);
} catch (err) {
if (
err.message.startsWith(
Copy link
Author

Choose a reason for hiding this comment

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

If populate exists already extendSchema will throw. In this case we want to return the schema as is

@andyrichardson andyrichardson merged commit 83ea87e into master Apr 29, 2020
@andyrichardson andyrichardson deleted the fix/populate-exchange branch April 29, 2020 15:57
@andyrichardson andyrichardson changed the title fix: Remove error tooltip for populate directives Remove error tooltip for populate directives Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants