Conversation
samcoe
commented
Jan 13, 2023
d095cb8 to
1ed0150
Compare
mislav
approved these changes
Apr 12, 2023
Contributor
mislav
left a comment
There was a problem hiding this comment.
Thanks for doing the work! One tiny ask I would have is to use the full term GraphQL instead of GQL, since GQL as a proposal is a different query language than GraphQL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces some API changes that are breaking and thus constitute bumping the major version to 2.0.0. This PR is best viewed by commits as each changes an individual package.
Changes by package:
CurrentRepositoryfunction from top levelghpackage torepositorypackage. This felt like a more natural place for it.CurrentRepositoryfunction toCurrentas it is now in therepositorypackage.Repositoryinterface type to concrete type. The interface was not serving any purpose as there was only one implementation of it. Allowed for removing ofinternal/repository/repository.go.GQLtoGraphQL.RESTClientfunction from top levelghpackage toapipackage. This made more sense in theapipackage than at the top level.GQLClientfunction from top levelghpackage toapipackage. This made more sense in theapipackage than at the top level.HTTPClientfunction from top levelghpackage toapipackage. This made more sense in theapipackage than at the top level.RESTClientinterface type to concrete type. The interface was not serving any purpose as there was only one implementation of it.GQLClientinterface type to concrete type. The interface was not serving any purpose as there was only one implementation of it.ClientOptionsto be used with value semantics instead of pointer semantics. This allowsClientOptionsto be used in multiple clients without having to worry about them being modified.HTTPErrorandGQLErrorcustom error types to take pointers as method receivers. This is a Go convention which should be followed unless good reason not to.DefaultRESTClient,DefaultHTTPClient,DefaultGQLClientconvenience functions. With the change to using value semantics for the options these felt nice to have.internal/apifolder.GQLClientQueryandMutatemethods to returnGQLErrorinstead ofshurcooL/graphql.Errors.Newfactory function to return*Browserinstead ofBrowser. All methods onBrowseruse*Browseras the receiver so we should be returning a pointer.InvalidConfigFileErrorandKeyNotFoundErrorcustom error types to take pointers as method receivers. This is a Go convention which should be followed unless good reason not to.Newfactory function to return*Templateinstead ofTemplate. All methods onTemplateuse*Templateas the receiver so we should be returning a pointer.Fixes #97