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

Prefer buildClientSchema to buildSchema #176

Merged
merged 1 commit into from
Aug 26, 2020
Merged

Conversation

keyfer
Copy link
Contributor

@keyfer keyfer commented Aug 24, 2020

Added a new rule, @shopify/typescript/prefer-build-client-schema, which flags uses of buildSchema and recommends using buildClientSchema instead due to our findings in performance.

For more information on the performance findings, check here.

@keyfer keyfer changed the title [WIP] Prefer buildClientSchema Prefer buildClientSchema to buildSchema Aug 26, 2020
Copy link
Contributor

@ismail-syed ismail-syed left a comment

Choose a reason for hiding this comment

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

🚢

Copy link
Contributor

@jtsmills jtsmills left a comment

Choose a reason for hiding this comment

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

⛵ Looks good to me! Thanks for grabbing this Keyfer!

function report(node) {
context.report({
node,
message: `Prefer buildClientSchema to buildSchema`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about this, but due to not knowing how buildSchema could be used, and the differences in implementation, applying a standardized fix across x number of repos, with x implementations could get weird.

@keyfer keyfer merged commit b012d2c into main Aug 26, 2020
@keyfer keyfer deleted the prefer-build-client-schema branch August 26, 2020 20:46
@keyfer keyfer temporarily deployed to production August 26, 2020 20:58 Inactive
@jmreid
Copy link
Member

jmreid commented Nov 2, 2020

Looks like new Rails apps generated with dev init will fail yarn lint out of the box now:
https://github.com/Shopify/shopify-rails/blob/c764ea5ebbbc412d469c13db0541b14b31eda4b4/lib/shopify/rails/templates/shopify/web/tests/graphql.ts#L5

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.

5 participants