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

feat(gatsby): allow schema customization #11480

Merged
merged 111 commits into from Mar 19, 2019
Merged

feat(gatsby): allow schema customization #11480

merged 111 commits into from Mar 19, 2019

Conversation

@freiksenet
Copy link
Contributor

@freiksenet freiksenet commented Feb 1, 2019

Rendered release blog post

Is in runnable state right now. Try it:

yarn add gatsby@schema-customization

Report all bugs in #12272.

Description

Related Issues

@freiksenet freiksenet requested a review from gatsbyjs/core as a code owner Feb 1, 2019
@freiksenet
Copy link
Contributor Author

@freiksenet freiksenet commented Feb 4, 2019

My next plans:

  • Confirm www can build
  • Add addTypeDefs and addResolvers apis
  • Put this under a flag
  • Port all tests
  • Make an RFC and try to get feedback
  • Get it merged

Longer term stuff / nice to haves

  • API to add directives
  • Better resolver writing experience
  • Clean up of inference
  • Schema directives to selectively enable/disable inference for types
type: `String!`,
})
})
InternalTC.getITC()

This comment has been minimized.

@stefanprobst

stefanprobst Feb 5, 2019
Collaborator

Probably not needed now that we use toInputObjectType directly (same with NodeInterface.getITC()) - We called this here to register a non-prefixed name (Nodenput and not MarkdownParentNodeInput - but we should try to remove prefixing upstream)

This comment has been minimized.

@freiksenet

freiksenet Feb 12, 2019
Author Contributor

What do you mean by "remove prefixing upstream"?

This comment has been minimized.

@stefanprobst

stefanprobst Feb 12, 2019
Collaborator

Just not adding the type name here

This comment has been minimized.

@freiksenet

freiksenet Feb 12, 2019
Author Contributor

One thing I was thinking about is introducing concept of a "TypeSetComposer" which is an abstraction on top of TypeComporers, InputTypeComposers etc and allows defining dependencies and transformations. Eg we can then write own getITC that knows how to not prefix. This would also solve the issue with clearing the ITC cache.

This comment has been minimized.

@stefanprobst

stefanprobst Feb 12, 2019
Collaborator

I'll have to think a bit about this, but not sure if we need to do much more than we already have: can we just call tc.removeInputTypeComposer(); tc.getITC() here? What other issues would TypeSetComposer address?

This comment has been minimized.

@freiksenet

freiksenet Feb 12, 2019
Author Contributor

I thought it might also have all the other type composers linked, like filter, sort etc. So we could clear all the generated types in one go when original type changes. Could be useful for things like live schema reload.

@freiksenet freiksenet changed the title [WIP] Schema refactor Schema refactor Mar 18, 2019
DSchau and others added 3 commits Mar 18, 2019
* chore(blog): add schema customization blog post release

* chore: tweak first sentence

* Update docs/blog/2019-03-18-releasing-new-schema-customization/index.md

Co-Authored-By: DSchau <DSchau@users.noreply.github.com>

* Update docs/blog/2019-03-18-releasing-new-schema-customization/index.md

Co-Authored-By: DSchau <DSchau@users.noreply.github.com>

* Update docs/blog/2019-03-18-releasing-new-schema-customization/index.md

Co-Authored-By: DSchau <DSchau@users.noreply.github.com>

* Update docs/blog/2019-03-18-releasing-new-schema-customization/index.md

Co-Authored-By: DSchau <DSchau@users.noreply.github.com>

* Update docs/blog/2019-03-18-releasing-new-schema-customization/index.md

Co-Authored-By: DSchau <DSchau@users.noreply.github.com>

* Update docs/blog/2019-03-18-releasing-new-schema-customization/index.md

Co-Authored-By: DSchau <DSchau@users.noreply.github.com>

* chore: address feedback

* Update docs/blog/2019-03-18-releasing-new-schema-customization/index.md
Co-Authored-By: freiksenet <freiksenet@gmail.com>
@pieh
pieh approved these changes Mar 19, 2019
Copy link
Contributor

@pieh pieh left a comment

Awesome work on this @freiksenet and @stefanprobst! We were testing and verifying this on multiple open source sites checking if it breaks things and it looks solid right now

@pieh pieh changed the title Schema refactor feat(gatsby): allow schema customization Mar 19, 2019
@freiksenet freiksenet merged commit 07e69be into master Mar 19, 2019
9 of 16 checks passed
9 of 16 checks passed
ci/circleci: e2e_tests_development_runtime Your tests failed on CircleCI
Details
ci/circleci: e2e_tests_gatsby-image Your tests failed on CircleCI
Details
ci/circleci: e2e_tests_gatsbygram Your tests failed on CircleCI
Details
ci/circleci: e2e_tests_path-prefix Your tests failed on CircleCI
Details
ci/circleci: e2e_tests_production_runtime Your tests failed on CircleCI
Details
ci/circleci: integration_tests_gatsby_pipeline Your tests failed on CircleCI
Details
ci/circleci: integration_tests_long_term_caching Your tests failed on CircleCI
Details
@gatsbot
Danger All good
Details
@gatsbot
Peril All green. Good on 'ya.
Details
ci/circleci: bootstrap Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: starters_validate Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node10 Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node6 Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node8 Your tests passed on CircleCI!
Details
@azure-pipelines
unit_tests_windows Build #20190319.31 succeeded
Details
@wardpeet wardpeet deleted the schema-refactor-new branch Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants