You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For strain and plasmid, we had to create our own custom models rather than just pointing them to the original protocol buffer struct. Should we update the other models to match this format, or should we leave them pointing directly at the protocol buffers?
The text was updated successfully, but these errors were encountered:
After further review, yes we should use custom models. This will enable us to only create resolvers for what is actually needed and it will remove a lot of redundant code. See the latest models used for Strain and Plasmid for examples on how to do so.
Add new file in models package with your custom models.
Update gqlgen.yml to point at the new model and specify any resolvers that need to be handled individually. For now, this would likely only be certain stock fields that retrieve data from annotations, not stock db.
Run script -- go generate ./...
Check diff of genresolver.go and make note of the methods that were removed. Now go to individual resolver file, i.e. resolver/order/order.go and remove those same resolvers.
Run unit tests and build the application to check for anything else that might need to be changed for the new models.
erichartline
changed the title
Should we use custom models for all services?
Use custom models for all services
May 18, 2020
For strain and plasmid, we had to create our own custom models rather than just pointing them to the original protocol buffer
struct
. Should we update the other models to match this format, or should we leave them pointing directly at the protocol buffers?The text was updated successfully, but these errors were encountered: