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 source reprinting #1019

Merged
merged 2 commits into from
Feb 8, 2020
Merged

Remove source reprinting #1019

merged 2 commits into from
Feb 8, 2020

Conversation

vektah
Copy link
Collaborator

@vektah vektah commented Feb 8, 2020

Removes the MutateSchema plugin hook, the only schema changes we need right now are additive. This means:

  • The embedded source in generated.go keeps correct line/file/position info for error messages.
  • Federation code can be simplified a little
  • We can now use extend type Foo to extend remote federated types, rather than @extends
  • sdl method now echos back the real user schema, rather than a synthesised one

We will likely need to bring MutateSchema back at some point to handle relay Connections, but lets cross that bridge when we get to it.

@marwan-at-work

Re-up of #1015

Copy link
Contributor

@marwan-at-work marwan-at-work left a comment

Choose a reason for hiding this comment

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

much cleaner 💯

var schemaRaw []byte
schemaRaw, err = ioutil.ReadFile(filename)
if err != nil {
fmt.Fprintln(os.Stderr, "unable to open schema: "+err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

why not return an error like the rest of the error blocks within the function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just copy paste, thanks :)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 65.531% when pulling 2f0fa0e on remove-source-reprinting into e289aaa on master.

@vektah vektah merged commit ab8d62b into master Feb 8, 2020
@vektah vektah deleted the remove-source-reprinting branch February 8, 2020 09:36
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
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.

3 participants