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

Stabilize output #104

Closed
cometkim opened this issue Aug 31, 2020 · 3 comments
Closed

Stabilize output #104

cometkim opened this issue Aug 31, 2020 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@cometkim
Copy link
Owner

cometkim commented Aug 31, 2020

The plugin artifacts should support stable output to be able to commit without redundant diffs.

Need to either modify the algorithm or prettify the output so order and format will not be changed for the same document.

@cometkim cometkim added the enhancement New feature or request label Aug 31, 2020
@cometkim cometkim self-assigned this Aug 31, 2020
@cometkim cometkim changed the title Prettify output Stabilize output Oct 18, 2020
@cometkim cometkim added Hacktoberfest Enjoy the festival! help wanted Extra attention is needed labels Oct 18, 2020
@cometkim cometkim added this to the v3 milestone Oct 27, 2020
@cometkim cometkim removed their assignment Oct 27, 2020
@cometkim cometkim removed the Hacktoberfest Enjoy the festival! label Nov 12, 2020
@noVerity
Copy link

I tried looking at this, but I've run out of time and need to get back to other things, so I thought I'd just leave some notes.
gatsby/graphql offers lexicographicSortSchema as an export. Running that in emitSchema.ts seems to update the output correctly (haven't verified) for the main schema which would just leave the plugin documents.
Unfortunately the package doesn't have the same for the fragments (or I haven't found it) so that would leave it to writing some sorter anyway or relying on something https://github.com/gajus/format-graphql etc.
Also to note is the difference in the schema between running gatsby with develop or build since one let's you query for the host and port values, which can then provide an inconsistent file.

@cometkim
Copy link
Owner Author

Thanks @noVerity, that's great to know graphql-js has lexicographicSortSchema utility. I think documents other than schemas always depend on the user-defined order, so we don't have to touch them.

Also to note is the difference in the schema between running gatsby with develop or build since one let's you query for the host and port values, which can then provide an inconsistent file.

yep, there is an issue opened for it #103, #131 and I'm working on v3. It will be done easily by using graphql visitor.

@cometkim cometkim removed the help wanted Extra attention is needed label Jun 1, 2021
@cometkim cometkim mentioned this issue Jun 1, 2021
Closed
30 tasks
@cometkim
Copy link
Owner Author

This will be fixed in v3. Thanks again @noVerity

cometkim added a commit that referenced this issue Jun 12, 2022
rc.0
- implemente XState based scheduler
- stabilize schema output
- bump GCG
- upgrade yarn to v3
- rewritten core logics
- upgrade eslint to v8
- upgrade plugin's dependencies
- pin graphql version
- rewrite emitSchema service
- rewriten emitPluginDocument service
- rewriten codegen service
- add TS & Flow examples

rc.1
- skip running on cloud build
- fix config validation
- more contexture reporting
- turn `flattenGeneratedTypesIncludeFragments` true
- stabilize documents
- change maybe type to use `null` instead of `undefined`
- update README

rc.2
- add mdx example
- MDX example to validate regression of [#117]
- update dependencies
- added support for `GatsbyImageData` scalar

Resolves #40
Resolves #103
Resolves #104
Resolves #109
Fixes #113
Fixes #117
Fixes #120
Resolves #122
Fixes #124
Resolves #131
Fixes #139, #99
Resolves #146
Fixes #157
Fixes #159
Fixes #160
Fixes #161
Fixes #162
Resolves #168
Resolves #169
Fixes #171

[#117]: #117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants