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

fix: remove global Client property on generated structs #6716

Merged
merged 2 commits into from Mar 5, 2024

Conversation

jedevc
Copy link
Member

@jedevc jedevc commented Feb 22, 2024

See discussion in discord: https://discord.com/channels/707636530424053791/1120503349599543376/1209815200023191662

#6680 made Client and Query reserved fields on all objects - but it's quite common to define Client on objects.

This patch is a little bit of a refactoring I've wanted to do for a while - it essentially allows binding clients to querybuilder.Selections, which means we can pretty much do away with Client+Query combinations, now we only need to track Query (and the client gets automagically inherited).

We still have this issue for Query. Gonna keep thinking about this one.

Signed-off-by: Justin Chadwell <me@jedevc.com>
@jedevc jedevc requested review from vito and sipsma February 22, 2024 15:05
Signed-off-by: Justin Chadwell <me@jedevc.com>
@jedevc
Copy link
Member Author

jedevc commented Feb 22, 2024

@vito also suggested we could use XXX_ prefixing, as in

type GraphQLMarshaller interface {
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
XXX_GraphQLType() string
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
XXX_GraphQLIDType() string
// XXX_GraphqlID is an internal function. It returns the underlying type ID
XXX_GraphQLID(ctx context.Context) (string, error)

Copy link
Contributor

@vito vito left a comment

Choose a reason for hiding this comment

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

LGTM as-is, we can consider that XXX_ prefix in the future if/when this comes up again for Query (I suspect it will)

@jedevc jedevc merged commit 62ced56 into dagger:main Mar 5, 2024
43 checks passed
@jedevc jedevc deleted the querybuilder-simplification branch March 5, 2024 09:25
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.

Codegen error when installing certain dependencies in a Go module
3 participants