gqlgen
gqlgen copied to clipboard
Update generated stubs
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 https://github.com/golang/go/issues/20744 might make this tricky. Perhaps it needs to use the AST to make decisions but do the edits on the raw file bytes?
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.
any update?
Apparently https://github.com/dave/dst is a thing that is good
Any progress on this?
Any progress on this?
Any progress on this?