Skip to content

Commit

Permalink
Merge branch 'master' into use-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenACoffman authored Jul 3, 2022
2 parents e7b99dc + 0c11e5f commit 4f3aaac
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 16 deletions.
97 changes: 96 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,105 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<a name="unreleased"></a>
## [Unreleased](https://github.com/99designs/gqlgen/compare/v0.17.10...HEAD)
## [Unreleased](https://github.com/99designs/gqlgen/compare/v0.17.11...HEAD)

<!-- end of if -->
<!-- end of CommitGroups -->
<a name="v0.17.11"></a>
## [v0.17.11](https://github.com/99designs/gqlgen/compare/v0.17.10...v0.17.11) - 2022-07-03
- <a href="https://github.com/99designs/gqlgen/commit/ea294c4ea344186c3b41b82d5f1c60138f6ce05e"><tt>ea294c4e</tt></a> release v0.17.11

- <a href="https://github.com/99designs/gqlgen/commit/8ebf75c19d775ddbd12b3d94461b605ef4c5f711"><tt>8ebf75c1</tt></a> Update gqlparser (<a href="https://github.com/99designs/gqlgen/pull/2270">#2270</a>)

<dl><dd><details><summary><a href="https://github.com/99designs/gqlgen/commit/b8497f52fde0803277d981405cd2e42ce0455a70"><tt>b8497f52</tt></a> github: Fix CI pipelines (<a href="https://github.com/99designs/gqlgen/pull/2266">#2266</a>)</summary>

* github: Test more go versions

* github: Fix ci tests

* github: Increase verbosity, sleep

* github: Drop bash

* github: Test go 1.18 and newer node verisons

* github: Pull out node 16 for now

* github: Only lint 1.16 for now

</details></dd></dl>

<dl><dd><details><summary><a href="https://github.com/99designs/gqlgen/commit/c287a7b0b40cdd8c94077ed54fff257fe383e796"><tt>c287a7b0</tt></a> codegen: fix resolvers execution order (<a href="https://github.com/99designs/gqlgen/pull/2267">#2267</a>)</summary>

* codegen: fix run order of resolver


* fix: update code generate

* fix: update stub, root to generate resolver for input

* fix: added unit-test for input field order

* fix: added test for singlefile

</details></dd></dl>

<dl><dd><details><summary><a href="https://github.com/99designs/gqlgen/commit/8481457f2fd6ae711f688fc4726d724df5992b8c"><tt>8481457f</tt></a> gqlgen: Add resolver comment generation and preservation (<a href="https://github.com/99designs/gqlgen/pull/2263">#2263</a>)</summary>

* gqlgen: Add resolver comment generation and preservation

* gqlgen: Regenerate

</details></dd></dl>

- <a href="https://github.com/99designs/gqlgen/commit/532d46af5b2b97f5b69ebd1ce261a191e2690fa3"><tt>532d46af</tt></a> Make uploads content seekable (<a href="https://github.com/99designs/gqlgen/pull/2247">#2247</a>)

<dl><dd><details><summary><a href="https://github.com/99designs/gqlgen/commit/34bbc450c502919cd46c5eefcc66341ef697c0e8"><tt>34bbc450</tt></a> Use the go:embed API to lookup templates (<a href="https://github.com/99designs/gqlgen/pull/2262">#2262</a>)</summary>

* Switch the templates package internally to read from TemplateFS

Users are expected to pass in the FS by using the embed API.

* Update all usages of templates.Render to use the TemplateFS option

* Fix unit tests

* Fix linter error

* Commit generated changes

Doesn't look like anything has changed though. Maybe just a different
whitespace character.

* Fix test

</details></dd></dl>

<dl><dd><details><summary><a href="https://github.com/99designs/gqlgen/commit/53ca207a4c53c78e4dec1e4d34d3b9251dd00b0b"><tt>53ca207a</tt></a> Fix PR links in CHANGELOG.md (<a href="https://github.com/99designs/gqlgen/pull/2257">#2257</a>)</summary>

* fix "PR" regex in CHANGELOG-full-history.tpl.md

* regenerate CHANGELOG.md

</details></dd></dl>

<dl><dd><details><summary><a href="https://github.com/99designs/gqlgen/commit/53ada82edb7e8bb91059cbf3f344270a668934c5"><tt>53ada82e</tt></a> Replace deprecated ioutil pkg with os & io (<a href="https://github.com/99designs/gqlgen/pull/2254">#2254</a>)</summary>

As of Go 1.16, the same functionality is now provided by package io or
package os, and those implementations should be preferred in new code.

So replacing all usage of ioutil pkg with io & os.

</details></dd></dl>

- <a href="https://github.com/99designs/gqlgen/commit/a8f112e0c5b3466de2f550e68cbe872233f052ac"><tt>a8f112e0</tt></a> update changelog

- <a href="https://github.com/99designs/gqlgen/commit/82fbbe4163459cbb8d862c99931fcd015ed756e6"><tt>82fbbe41</tt></a> v0.17.10 postrelease bump

<!-- end of Commits -->
<!-- end of Else -->

<!-- end of If NoteGroups -->
<a name="v0.17.10"></a>
## [v0.17.10](https://github.com/99designs/gqlgen/compare/v0.17.9...v0.17.10) - 2022-06-13
- <a href="https://github.com/99designs/gqlgen/commit/4ff9ea92b0d90f7fdc7c22bec592fbec1aca60a6"><tt>4ff9ea92</tt></a> release v0.17.10
Expand Down
2 changes: 1 addition & 1 deletion _examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/rs/cors v1.8.0
github.com/stretchr/testify v1.7.1
github.com/vektah/dataloaden v0.3.0
github.com/vektah/gqlparser/v2 v2.4.5
github.com/vektah/gqlparser/v2 v2.4.6
sourcegraph.com/sourcegraph/appdash v0.0.0-20210831040556-ec77a7fbcadc
)

Expand Down
4 changes: 2 additions & 2 deletions _examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY
github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY=
github.com/vektah/dataloaden v0.3.0 h1:ZfVN2QD6swgvp+tDqdH/OIT/wu3Dhu0cus0k5gIZS84=
github.com/vektah/dataloaden v0.3.0/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U=
github.com/vektah/gqlparser/v2 v2.4.5 h1:C02NsyEsL4TXJB7ndonqTfuQOL4XPIu0aAWugdmTgmc=
github.com/vektah/gqlparser/v2 v2.4.5/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0=
github.com/vektah/gqlparser/v2 v2.4.6 h1:Yjzp66g6oVq93Jihbi0qhGnf/6zIWjcm8H6gA27zstE=
github.com/vektah/gqlparser/v2 v2.4.6/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/mitchellh/mapstructure v1.3.1
github.com/stretchr/testify v1.7.1
github.com/urfave/cli/v2 v2.8.1
github.com/vektah/gqlparser/v2 v2.4.5
github.com/vektah/gqlparser/v2 v2.4.6
golang.org/x/text v0.3.7
golang.org/x/tools v0.1.10
google.golang.org/protobuf v1.28.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMT
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4=
github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY=
github.com/vektah/gqlparser/v2 v2.4.5 h1:C02NsyEsL4TXJB7ndonqTfuQOL4XPIu0aAWugdmTgmc=
github.com/vektah/gqlparser/v2 v2.4.5/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0=
github.com/vektah/gqlparser/v2 v2.4.6 h1:Yjzp66g6oVq93Jihbi0qhGnf/6zIWjcm8H6gA27zstE=
github.com/vektah/gqlparser/v2 v2.4.6/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
Expand Down
23 changes: 15 additions & 8 deletions graphql/handler/transport/http_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"io"
"net/http"
"net/url"
"strings"

"github.com/99designs/gqlgen/graphql"
Expand All @@ -27,24 +28,30 @@ func (h GET) Supports(r *http.Request) bool {
}

func (h GET) Do(w http.ResponseWriter, r *http.Request, exec graphql.GraphExecutor) {
query, err := url.ParseQuery(r.URL.RawQuery)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
writeJsonError(w, err.Error())
return
}
w.Header().Set("Content-Type", "application/json")

raw := &graphql.RawParams{
Query: r.URL.Query().Get("query"),
OperationName: r.URL.Query().Get("operationName"),
Query: query.Get("query"),
OperationName: query.Get("operationName"),
Headers: r.Header,
}
raw.ReadTime.Start = graphql.Now()

if variables := r.URL.Query().Get("variables"); variables != "" {
if variables := query.Get("variables"); variables != "" {
if err := jsonDecode(strings.NewReader(variables), &raw.Variables); err != nil {
w.WriteHeader(http.StatusBadRequest)
writeJsonError(w, "variables could not be decoded")
return
}
}

if extensions := r.URL.Query().Get("extensions"); extensions != "" {
if extensions := query.Get("extensions"); extensions != "" {
if err := jsonDecode(strings.NewReader(extensions), &raw.Extensions); err != nil {
w.WriteHeader(http.StatusBadRequest)
writeJsonError(w, "extensions could not be decoded")
Expand All @@ -54,10 +61,10 @@ func (h GET) Do(w http.ResponseWriter, r *http.Request, exec graphql.GraphExecut

raw.ReadTime.End = graphql.Now()

rc, err := exec.CreateOperationContext(r.Context(), raw)
if err != nil {
w.WriteHeader(statusFor(err))
resp := exec.DispatchError(graphql.WithOperationContext(r.Context(), rc), err)
rc, gqlError := exec.CreateOperationContext(r.Context(), raw)
if gqlError != nil {
w.WriteHeader(statusFor(gqlError))
resp := exec.DispatchError(graphql.WithOperationContext(r.Context(), rc), gqlError)
writeJson(w, resp)
return
}
Expand Down
2 changes: 1 addition & 1 deletion graphql/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package graphql

const Version = "v0.17.10-dev"
const Version = "v0.17.11-dev"

0 comments on commit 4f3aaac

Please sign in to comment.