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

Bring in latest changes from shurcool/graphql #10

Merged
merged 10 commits into from
Oct 6, 2023
Merged

Conversation

samcoe
Copy link

@samcoe samcoe commented Oct 5, 2023

Following #7 I found out that shurcool/graphql actually removed golang.org/x/net as a dependency which I think is a better solution. This PR pulls in the latest changes from shurcool/graphql and merges them with our changes. Additionally, it updates to Go 1.21 as shurcool/graphql was already on Go 1.19, and this felt like a small step.

The majority of these code changes are just changing interface{} -> any.

Apologies for all the churn with this change.

dmitshur and others added 9 commits May 19, 2022 23:34
These help generate nicer identifiers in the githubv4 package.

Also remove mention of golint since it's deprecated, and sort
the initialisms map.
Also consider "@" when looking for the end of the field name, since
GraphQL directives can follow a field name immediately without any
arguments or aliases being involved. For example:

	query {
		me {
			firstName
			lastName @include(if: $expandedInfo)
		}
	}

The strings.Index check for "@" is the third separator we look for.
There's no reason to look separately, since we just want the first
field name separator.

Add test covering a GraphQL directive that immediately follows the
field name.

Co-authored-by: Dmitri Shuralyov <[email protected]>
GitHub-Pull-Request: shurcooL#94
Ignore example/graphqldev for now to avoid needing its dependencies
for 'go test all' and the module as a whole.
Package ioutil is longer and deprecated.
Package graphql has only one ctxhttp.Post call that requires
the golang.org/x/net module. It's easy enough to use net/http
directly and drop x/net so there are fewer dependencies that
need to be maintained.

Co-authored-by: Dmitri Shuralyov <[email protected]>
GitHub-Pull-Request: shurcooL#110
The predeclared identifier 'any', an alias for the empty interface,
is available as of Go 1.18. Use it in place of 'interface{}' since
it's slightly shorter.

GitHub-Pull-Request: shurcooL#109
User newer and more consistent links.

GitHub-Pull-Request: shurcooL#113
@samcoe samcoe self-assigned this Oct 5, 2023
Comment on lines +78 to +83
req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.url, &buf)
if err != nil {
return err
}
req.Header.Set("Content-Type", "application/json")
resp, err := c.httpClient.Do(req)
Copy link
Author

Choose a reason for hiding this comment

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

This is the change that allows for dropping golang.org/x/net as a dependency.

@samcoe samcoe marked this pull request as ready for review October 5, 2023 15:55
@samcoe samcoe changed the title Update from origin Bring in latest changes from shurcool/graphql Oct 5, 2023
@samcoe samcoe merged commit 73d4805 into trunk Oct 6, 2023
10 checks passed
@samcoe samcoe deleted the update-from-origin branch October 6, 2023 06:02
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.

5 participants