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

Update generated stubs #216

Open
vektah opened this issue Jul 23, 2018 · 6 comments
Open

Update generated stubs #216

vektah opened this issue Jul 23, 2018 · 6 comments
Labels

Comments

@vektah
Copy link
Collaborator

vektah commented Jul 23, 2018

It would be very useful to compare current schema to a set of RootResolvers (passed in as args? maybe in config?) and add any missing resolvers as stubs to the generated code.

Bonus points for dealing with conflicts.

This is a long standing idea thats been floating around since #9.

@matthewmueller mentioned golang/go#20744 might make this tricky. Perhaps it needs to use the AST to make decisions but do the edits on the raw file bytes?

@vektah vektah created this issue from a note in 1.0 Release (Features) Jul 23, 2018
@matthewmueller
Copy link

matthewmueller commented Jul 23, 2018

Regarding conflicts, the way I've been thinking about this is:

Add resolver no conflict, ideally add in the proper order as the schema, but bottom of the file is okay too.

Update resolver schema is source of truth, update function signature, but don't change function body. If the user defined return value variables, leave those intact too. Cheap alternative is to just print out what needs to be changed and let the user do it manually.

Delete resolver never delete code. Instead, mark the resolver as unused by prepending _ to the resolver function.

@creativej creativej moved this from Features to In progress in 1.0 Release Jul 24, 2018
@vektah vektah moved this from In progress to Features in 1.0 Release Aug 3, 2018
@vektah vektah moved this from Features to In progress in 1.0 Release Aug 27, 2018
@vektah vektah mentioned this issue Aug 28, 2018
2 tasks
@igtm
Copy link

igtm commented Aug 22, 2019

any update?

@mtibben
Copy link
Member

mtibben commented Sep 16, 2019

Apparently https://github.com/dave/dst is a thing that is good

@vektah vektah changed the title gqlgen sync Update generated stubs Sep 19, 2019
@nadilas
Copy link

nadilas commented Jan 2, 2020

Any progress on this?

2 similar comments
@exfly
Copy link

exfly commented Mar 12, 2020

Any progress on this?

@borisbsv
Copy link

borisbsv commented Nov 4, 2021

Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants