Skip to content

Latest commit

 

History

History
9285 lines (5001 loc) · 536 KB

CHANGELOG.md

File metadata and controls

9285 lines (5001 loc) · 536 KB

CHANGELOG

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

v0.17.12 - 2022-07-04

0b0e5ce4 Replace use of strings.Title with cases.Title (#2268)
  • 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

  • cases: Use cases.Title over strings.Title which is deprecated

  • gqlgen: Remove use of deprecated strings.Title

v0.17.11 - 2022-07-03

b8497f52 github: Fix CI pipelines (#2266)
  • 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

c287a7b0 codegen: fix resolvers execution order (#2267)
  • 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

8481457f gqlgen: Add resolver comment generation and preservation (#2263)
  • gqlgen: Add resolver comment generation and preservation

  • gqlgen: Regenerate

34bbc450 Use the go:embed API to lookup templates (#2262)
  • 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
53ca207a Fix PR links in CHANGELOG.md (#2257)
  • fix "PR" regex in CHANGELOG-full-history.tpl.md

  • regenerate CHANGELOG.md

53ada82e Replace deprecated ioutil pkg with os & io (#2254)

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.

v0.17.10 - 2022-06-13

c355df9e fix #1876: Optional Any type should allow nil values (#2231)
  • Anonymous func that checks value of arg type interface for nil

  • Added unit test for CallArgs()

  • Fixed type of argument in unit test

v0.17.9 - 2022-05-26

6855b729 fix: prevent goroutine leak and CPU spinning at websocket transport (#2209) (closes #2168)
  • Added goroutine leak test for chat example

  • Improved chat example with proper concurrency

This reverts commit eef7bfaad1b524f9e2fc0c1150fdb321c276069e.

  • Improved subscription channel usage

  • Regenerated examples and codegen

  • Add support for subscription keepalives in websocket client

  • Update chat example test

  • if else chain to switch

  • Revert "Add support for subscription keepalives in websocket client"

This reverts commits 64b882c3c9901f25edc0684ce2a1f9b63443416b and 670cf22272b490005d46dc2bee1634de1cd06d68.

  • Fixed chat example race condition

  • Fixed chatroom#Messages type

5f5bfcb9 fix #2204 - don't try to embed builtin sources (#2214)
  • dont't try to embed builtins

  • add test

  • generated code

  • fix error message string

v0.17.8 - 2022-05-25

v0.17.7 - 2022-05-24

8825ac46 Fix misprint (#2187)
  • Fix misprint

  • Fix misprint

  • Re-generate

v0.17.6 - 2022-05-23

f7bf453c Bump dset from 3.1.1 to 3.1.2 in /integration (#2176)

Bumps dset from 3.1.1 to 3.1.2.


updated-dependencies:

  • dependency-name: dset dependency-type: indirect ...
4cdf7026 Update getting-started.md (#2157)

Fix getting-started missing fields resolver config

f6b35231 Add argument to WebsocketErrorFunc (#2124)
  • Add argument to WebsocketErrorFunc

to determine whether the error ocured on read or write to the websocket.

  • Wrap websocket error
  • 0f016df3 Fix invalid query parameter for playground subscription endpoint (#2148)
fb5751ab use "embed" in generated code (#2119)
  • use "embed" in generated code

  • don't use embed for builtins

  • working poc

  • handle no embeddable sources

  • fix dir

  • comment

  • add test for embedding

  • improve error handling

d38911f1 Allow absolute https://github.com/99designs/gqlgens to the GraphQL playground (#2142)
  • Allow absolute URLs to the GraphQL playground

  • Add test for playground URLs

  • Close res.Body in playground test

3228f36f Update getting-started.md (#2140)
  • Update getting-started.md

function rand.Int requires two parameters and returns two value in golang version 1.18.1.

  • Highlight the package used so people don't pick crypto/rand

  • Revert to original

  • Remove extra space

33fe0b9b Update package.json (#2138)

I added graphql-ws because there is no graphql-ws in package.json

f8e837b8 Use MultipartReader to parse file uploads (#2135)

Use a streaming MultipartReader to parse requests with file uploads. The GraphQL multipart request specification guarantees that the operations and map form fields will come first.

There are two reasons motivating this change:

  • This allows for file uploads without specifying a specific filename.
  • This avoids unnecessary copies for requests with more than one file. Go's ParseForm already copies the request's body into memory or on disk. We were also doing this manually as a second step.

v0.17.5 - 2022-04-29

9250f9ac Feature: Add FTV1 Support via Handler (#2132)
  • initial support for ftv1 traces via handler

  • remove testing json extension

  • remove binary from commit and add to .gitignore

  • updating go.mod

  • updating examples go.sum

  • rerunning generate within the examples folder

fce3a11a feat: added graphql.UnmarshalInputFromContext (#2131)
  • feat: added graphql.UnmarshalInputFromContext

  • chore: run go generate for _examples

  • fix: apply suggestions from code review

  • fix: update error cases

  • fix: fixed unit-test by update root_.gotpl

  • fix: apply suggestions from code review

  • fix: update graphql/input.go

6a24e881 update instructions to specify package of Role (#2130)

Can't compile with the example unless I also include model. for Role.

v0.17.4 - 2022-04-25

2a2a3dcb Feature: Adds Federation 2 Support (#2115)
  • fed2 rough support

  • autodetection of fed2

  • adding basic tests for changes

  • fixing docs

  • Update plugin/federation/federation.go

  • removing custom scalar since it was causing issues

  • fixing lint test

  • should fix for real this time

  • fixing test failures

77260e88 shorten some generated code (#2120)
  • shorten some generated code

  • generate examples

4da17e1c update modules except mapstructure (#2118)
  • Update modules

  • Update modules except for mapstructure

  • Try to update to v1.3.1

v0.17.3 - 2022-04-20

8d0bd22a Update gqlparser (#2109)
  • Update gqlparser

  • Update tests to be NoError

ec0dea88 Fix the ability of websockets to get errors (#2097)

Because DispatchOperation creates tempResponseContext, which is passed into Exec, which is then used in _Subscription to generate the next function. Inside the various subscription functions when generating next the context was captured there.

Which means later when the returned function from DispatchOperation is called. The responseContext which accumulates the errors is the tempResponseContext which we no longer have access to to read the errors out of it.

Instead add a context to next() so that it can be passed through and accumulated the errors as expected.

Added a unit test for this as well.

e3f04b42 Change the error message to be consumer targeted (#2096)
  • Change the error message to be slightly more clear

  • Rebase on updated origin/master.

Fix the test to not be sensitive to array ordering. Re-generate on master as there was a schema change.

5a497649 Fix websocket subscriptions to not double close. (#2095)

We were closing at the end of the loop and also in the defer.

a1538928 Use Github API to update the docs (#2101)
  • Use Github API to update the docs

Instead of a hard-coded version of the docs we want to realease, this uses the Github API to get the last 20 versions and publish those. This will allow any script invoking this to make sure to always have the latest version of the docs

  • Reinstate set -e
12c6d0bf Fix misprint (#2102)
  • Fix misprint

  • Update websocket_graphql_transport_ws.go

9f5fad13 Bump minimist from 1.2.5 to 1.2.6 in /integration (#2085)

Bumps minimist from 1.2.5 to 1.2.6.


updated-dependencies:

  • dependency-name: minimist dependency-type: indirect ...
035e1d6e Add AllowedMethods field to transport.Options (#2080)
  • Add AllowedMethods field to transport.Options

to enable users to specify allowed HTTP methods.

  • Update graphql/handler/transport/options.go
12b0b385 Bump Playground version (#2078)
  • update playground

  • enables tabs

  • update shas

1324c3ff Merge pull request #2062 from a8m/childfield

graphql: add FieldContext.Child field function and enable it in codegen

  • bf9caeae graphql: add FieldContext.ChildArgs field and enable it in codegen

  • 36fb3dc6 codegen: allow binding methods with optional variadic arguments (#2066)

  • fba5edd4 Update Changelog

  • 48b2b7e1 v0.17.2 postrelease bump

v0.17.2 - 2022-03-21

v0.17.1 - 2022-03-02

9f520a28 Update golangci-lint and fix resource leak (#2024)
  • Fix golangci-lint in CI

  • Fix resource leak

v0.17.0 - 2022-03-01

082bbff6 Revert "Update quickstart (#1850)" (#2014)

This reverts commit 0ab636144bfc875f86e4d9fd7a2686bc57d5050c.

45e192ea Clean up docs to clarify how to use a particular version (#2015) (closes #1851)

This reverts commit 57a148f6d12572fe585ecfcafafbb7441dbf9cab.

  • Update getting-started.md

  • Update getting-started.md

5236fb09 fix introspection for description to be nullable (#2008)
  • fixed introspection for description to be nullable

  • regenerated for integration

  • regenerated

  • fixed introspection package

  • regenerated

82fefdb5 support to generate model for intermediate interface (#1982)
  • support to generate model for intermediate interface

  • go generate ./... in example

  • fixed filepath generation

3ec83635 Bump ajv from 6.10.2 to 6.12.6 in /integration (#2007)

Bumps ajv from 6.10.2 to 6.12.6.


updated-dependencies:

  • dependency-name: ajv dependency-type: indirect ...
9546de2c Web Socket initialization message timeout (#2006)
  • Added an optional timeout to the web socket initialization message read operation.

  • Added a fail message to a web socket init read timeout test.

f6ea6230 fixed introspection for schema description and specifiedByhttps://github.com/99designs/gqlgen (#1986)
  • fixed introspection for schema description and specifiedByURL

  • updated to the master latest

  • fixed Description resolver

  • updated integration go file

  • fixed codegen tests for the latest gqlparser

  • updated go mod in example

  • go generate

  • skip specifiedBy

  • regenerate

  • fixed schema-expected.graphql for the latest

  • fixed integration test to use latest tools

  • fixed integration workflow

  • use v2.4.0

  • fixed sum

ffa857ef Websocket i/o timeout fix (#1973)
  • Renamed "pingMesageType" to "pingMessageType" and refactored websocket_graphqlws.go to look more like websocket_graphql_transport_ws.go for the sake of consistency.

  • Made the keep-alive messages graphql-ws only, and the ping-pong messages graphql-transport-ws only (and added tests for it).

  • gofmt

d7da5b0d Merge pull request #1958 from 99designs/cleanup-main

Cleanup main

42f32432 Merge pull request #1957 from 99designs/move-init-ci

Upate init CI step

213a085b rename "example" dir to "_examples" (#1734)
  • rename "example" dir to "_examples"

  • fix lint

  • Adjust permissions

9262b358 fix: typo in dataloader code sample (#1954)
  • fix: typo in dataloader code sample

  • rename k to key for sample to compile

06bbca37 docs: migrate dataloaders sample to graph-gophers/dataloader (#1871)
  • docs: add dataloader sample

  • finish example

  • add example

  • simplify method

  • replace old example

  • styling

  • Update docs/content/reference/dataloaders.md

  • Update docs/content/reference/dataloaders.md

  • Update docs/content/reference/dataloaders.md

  • Update docs/content/reference/dataloaders.md

f9fcfa16 Comment out autobind in the sample config file (#1872)

The reason is that many people using it for the first time copy exactly that configuration example and then open the issues to say it doesn't work.

  • a30b68de fix: whitelist VERSION and CURRENT_VERSION env vars (#1870)
76a533b8 Bump gopkg.in/yaml.v2 from 2.2.4 to 2.2.8 (#1858)
  • Bump gopkg.in/yaml.v2 from 2.2.4 to 2.2.8

Bumps gopkg.in/yaml.v2 from 2.2.4 to 2.2.8.


updated-dependencies:

  • dependency-name: gopkg.in/yaml.v2 dependency-type: direct:production ...
  • Update go sum for example
eed4301c Bump node-fetch from 2.6.1 to 2.6.7 in /integration (#1859)

Bumps node-fetch from 2.6.1 to 2.6.7.


updated-dependencies:

  • dependency-name: node-fetch dependency-type: direct:development ...
57a148f6 Remove outdated version reference so example is always for latest (#1851)
  • Also update version reference to next

  • Update getting-started.md

a8eba26d Fix #1777 by updating version constant and adding release checklist (#1848)
  • Revise to use script 🤦

v0.16.0 - 2022-01-24

  • b90f9750 Merge branch 'master' of github.com:99designs/gqlgen

  • 99523e44 Prepare for v0.16.0 release (#1842)

  • 0563146c Prepare for v0.16.0 release

7cefef26 add PrependPlugin (#1839)
  • add PrependPlugin

related: 99designs#1838

  • added test for PrependPlugin
972878a0 Revert "Fix plugin addition (#1717)" (#1838)

This reverts commit f591c8f797e35635fb5eb0e4465c77b6a073896b.

1ed7e050 Fix #1832 [@requires](https://github.com/requires) directive when [@entityResolver](https://github.com/entityResolver) is used (#1833)
  • fix requires directive for multipleEntity directive

  • fix lint

fcee4c40 Update README.md (#1836)

Corrected a simple grammar typo.

3fb5fd99 Fix #1834: Implement federation correctly (#1835)
  • Fix federation implementation which does not conform to Apollo Federation subgraph specification

  • Optimize generated line breaks

  • Run go generate

98665071 Imporve gqlgen test cases (#1773) (closes #1765)
  • Imporve test cases for init and generate
5d904d87 Merge pull request #1778 from ipfans/gh-pages-patch

Bump gqlgen.com version list

v0.15.1 - 2022-01-16

2b8f50b3 Fix #1765: Sometimes module info not exists or not loaded. (#1767)
  • Remove failing test

v0.15.0 - 2022-01-14

931271a2 Fix #1762: Reload packages before merging type systems (#1763)
  • run gofmt on file
57664bf0 Migrate playgrounds to GraphiQL (#1751)
  • migrate to GraphiQL playground

  • fix lint

b2a832d5 Avoid problems with `val` being undefined in the federation template. (#1760)
  • Avoid problems with val being undefined in the federation template.

When running gqlgen over our schema, we were seeing errors like:

assignments/generated/graphql/service.go:300:4: val declared but not used

The generated code looks like this:

func entityResolverNameForMobileNavigation(ctx context.Context, rep map[string]interface{}) (string, error) {
        for {
                var (
                        m   map[string]interface{}
                        val interface{}
                        ok  bool
                )
                m = rep
                if _, ok = m["kaid"]; !ok {
                        break
                }
                m = rep
                if _, ok = m["language"]; !ok {
                        break
                }
                return "findMobileNavigationByKaidAndLanguage", nil
        }
        return "", fmt.Errorf("%w for MobileNavigation", ErrTypeNotFound)
}

Looking at the code, it's pretty clear that this happens when there are multiple key-fields, but each of them has only one keyField.Field entry. This is because the old code looked at len(keyFields) to decide whether to declare the val variable, but looks at len(keyField.Field) for each keyField to decide whether to use the val variable.

The easiest solution, and the one I do in this PR, is to just declare val all the time, and use a null-assignment to quiet the compiler when it's not used.

  • run go generate to update generated files

  • run go generate to update moar generated files

  • Adding a test for verify that this fixes the issue.

From plugins/federation, run the following command and verify that no errors are produced

go run github.com/99designs/gqlgen --config testdata/entityresolver/gqlgen.yml
47015f12 Added pointer to a solution for `no Go files` err (#1747)

While following the instructions in this getting started guide I run into this error package github.com/99designs/gqlgen: no Go files which was pretty annoying to fix. Its a golang issue but for people who are unfamiliar with how the go generate command works in vendored projects its a blocker trying to follow the rest of this guide. It will be really nice to at least have a pointer in the guide for people to find a possible solution to the issue while going through the guide. I'm sure many folks have run into this issue given vendoring is now very popular with the latest go releases.

14cfee70 Support for multiple [@key](https://github.com/key) directives in federation (reworked) (#1723)
  • address review comments
  • reworked code generation for federation.go
  • better checking for missing/incorrect parameters to entity resolver functions
  • better tests for generated entity resolvers

Still missing:

  • suggested test for autobind vs non-autobind generation
  • could probably clean up generated code spacing, etc
44beadc1 Fix list coercion when using graphql variables (#1740)
  • fix(codegen): support coercion of lists in graphql variables

This was broken by an upstream dependency gqlparser coercing variables during validation. this has broken the existing coercion process withing gqlgen

  • test: add list coercion integration tests

  • chore: regenerate generated code

  • test: update expected schema for integration tests

  • chore: run goimports

  • chore: regenerate examples

bd8938d8 fix: automatically register built-in directive goTag (#1737)
  • fix: automatically register built-in tag goTag

  • doc: add directive config documentation

497227fa Close Websocket Connection on Context close/cancel (#1728)
  • Added code to the web socket so it closes when the context is cancelled (with an optional close reason).

  • Added a test.

  • go fmt

  • Fix linter issues about the cancel function being thrown away.

213ecd93 Add support for graphql-transport-ws with duplex ping-pong (#1578)
  • Add support for graphql-transport-ws with duplex ping-pong

  • Add tests for the duplex ping-pong

af33b7cd Cleaning up extra return in federation generated code (#1713)

In PR 1709, I introduced GetMany semantics for resolving federated entities. But I left a couple of extra return statements in the generated code that are not necessary. So Im just cleaning those up here.

Also added go:generate in federation entity resolver tests to make it simpler to test.

To test:

go generate ./... && cd example/ && go generate ./... && cd ..
go test -race ./... && cd example && go test -race ./... && cd ..
402a2259 Optimize performance for binder, imports and packages (Rebased from sbalabanov/master) (#1711)
  • Cache go.mod resolution for module name search

  • Optimize binder.FindObject() for performance by eliminating repeatitive constructs

  • Optimize allocations in packages.Load() function

  • Optimize binder.FindObject() by indexing object definitions for each loaded package

  • goimports to fix linting

50292e99 Resolve multiple federated entities in a single entityResolve call (#1709)
  • Resolve multiple federated entities in a single entityResolve call

Entity resolver functions can only process one entity at a time. But often we want to resolve all the entities at once so that we can optimize things like database calls. And to do that you need to add you'd need to add batching with abstractions like dataloadgen or batchloader. The drawback here is that the resolver code (the domain logic) gets more complex to implement, test, and debug.

An alternative is to have entity resolvers that can process all the representations in a single call so that domain logic can have access to all the representations up front, which is what Im adding in this PR.

There are a few moving pieces here: 3. When that's configured, the federation plugin will create an entity resolver that will take a list of representations.

Please note that this is very specific to federation and entity resolvers. This does not add support for resolving fields in an entity.

Some of the implementation details worth noting. In order to efficiently process batches of entities, I group them by type so that we can process groups of entities at the same time. The resolution of groups of entities run concurrently in Go routines. If there is only one type, then that's just processed without concurrency. Entities that don't have multiget enabled will still continue to resolve concurrently with Go routines, and entities that have multiget enabled just get the entire list of representations.

The list of representations that are passed to entity resolvers are strongly types, and the type is generated for you.

There are lots of new tests to ensure that there are no regressions and that the new functionality still functions as expected. To test:

  1. Go to plugin/federation
  2. Generate files with go run github.com/99designs/gqlgen --config testdata/entityresolver/gqlgen.yml
  3. And run go test ./.... Verify they all pass.

You can look at the federated code in plugin/federation/testdata/entityresolver/gederated/federation.go

  • Added InputType in entity to centralize logic for generating types for multiget resolvers.

  • reformat and regenerate

80713b84 Adding entity resolver tests for errors, entities with different type… (#1708)
  • Adding entity resolver tests for errors, entities with different types, and requires

The tests in this PR are for ensuring we get the expected errors from entity resolvers, that we also handle resolving entities where the representations are for different types, and that requires directive works correctly.

To run tests:

  1. Go to plugin/federation
  2. Generate files with go run github.com/99designs/gqlgen --config testdata/entityresolver/gqlgen.yml
  3. And run go test ./.... Verify they all pass.
  • Fixed test for errors
  • ed2d6998 Replace ! with _ in root.generated file to avoid build conflicts (#1701)
828820af transport: implement `graphql-transport-ws` ws sub-protocol (#1507)
  • websocket: create messageExchanger to handle subprotocol messages

  • remove unused type

  • typo in comments

  • change graphqlwsMessageType type to string

  • add support for graphql-transport-ws subprotocol

  • fix chat app example

  • update example chat app dependencies

  • improve chat app exmaple to use the recommended ws library

  • add tests

  • removed unused const in tests

  • Update example/chat/readme.md

01d3c4f8 Entity resolver tests (#1697)
  • Moving federation tests to their own folders

Reorganizing the tests in the federation plugin a little bit so make it simpler to add more safely without testdata colliding. This is in anticipation for a follow up PR for adding entity resolver tests.

Run the tests with go test ./plugin/federation/... and verify they all pass. Also verify that the testdata/allthething directory has a generated directory specific to that test.

NOTE: There is a catch all type of test that I moved to the directory allthething. Open to suggestions for a better name! One potential thing to considere here is to split up the tests that use that testdata and break them down into more specific tests. E.g. Add a multikey test in the testdata/entity. For now, Im leaving that as a TODO.

  • Adding entity resolver tests in the federation plugin

The tests work by sending _entities queries with representation variables directly to the mocked server, which will allow us to test generated federation code end to end. For context, the format of the entity query is something like:

query($representations:[_Any!]!){_entities(representations:$representations){ ...on Hello{secondary} }}

And representations are the list of federated keys for the entities being resovled, and they look like

representations: [{
   "__typename": "Hello",
   "name":       "federated key value 1",
}, {
   "__typename": "Hello",
   "name":       "federated key value 2",
}]

The entity resolver tests are in plugin/federation/federation_entityresolver_test.go and they rely on plugin/federation/testdata/entityresolver.

To run the tests:

  1. Build the entityresolver testdata
  • From plugin/federation, run go run github.com/99designs/gqlgen --config testdata/entityresolver/gqlgen.yml
  1. Run the tests with go test ./... or similar
b7db36d3 Revert "Support for multiple [@key](https://github.com/key) directives in federation (#1684)" (#1698)

This reverts commit 47de912f56cd4bd6da9b74929cd67b8881617026.

47de912f Support for multiple [@key](https://github.com/key) directives in federation (#1684)
  • add more unit test coverage to plugin/federation
59a30919 Reimplement goTag using FieldMutateHook (#1682)
  • Reimplement goTag using a FieldMutateHook

This change does not change the logic of goTag, merely reimplements it using a FieldMutateHook and sets it as the default FieldMutateHook for the modelgen plugin.

  • Add repeated tag test
37a4e7ee Rename `[@extraTag](https://github.com/extraTag)` directive to `[@goTag](https://github.com/goTag)` and make repeatable (#1680)
  • Allow Repeatable goTag Directive

  • Default to field name if none provided

  • Update Docs

87f9e436 Fix nil pointer dereference when an invalid import is bound to a model (#1676)
  • Fixes remaining Name field in singlefile test

  • Fixes nill pointer dereference when an invalid import is bound to a model

  • Only return error if we failed to find type

  • Revert "Fixes remaining Name field in singlefile test"

This reverts commit e43ebf7aa80f884afdb3feca90867b1eff593f01.

  • Undo change of log.Println -> fmt.Println

Totally accidental, sorry!

6c65e8f1 Update getting-started.md (#1674)

missing an 's' on quoted filename default

  • 3bbc2a34 feat: generate resolvers for inputs if fields are missing (#1404)
7db941a5 Fix 1138: nested fieldset support (#1669)
  • formatting

  • update federation schema to latest Apollo spec

also: handle extra spaces in FieldSet upgrade deps in federation integration tests

488a31fc ContextMarshaler (#1652)
  • Add interface and detection for ContextMarshaler

  • Test error on float marshalling

  • Revert prettier changes

  • Rename context test

  • Only use the erroring float printer

  • Test that context is passed to marshal functions

  • Update scalar docs to include the context

  • Generate the examples

  • Move ContextMarshaller test code to new followschema

  • Resolve conflict a little more

  • Replicate sclar test for singlefile

8b973717 Update directives doc page (#1660)
  • Update directives doc page

  • Add back one beloved piece of jargon

1f500016 Add follow-schema layout for exec (#1309) (closes #1265)
  • Define ExecConfig separate from PackageConfig

When support for writing generated code to a directory instead of a single file is added, ExecConfig will need additional fields that will not be relevant to other users of PackageConfig.

  • Add single-file, follow-schema layouts

When ExecLayout is set to follow-schema, output generated code to a directory instead of a single file. Each file in the output directory will correspond to a single *.graphql schema file (plus a root!.generated.go file containing top-level definitions that are not specific to a single schema file).

ExecLayout defaults to single-file, which is the current behavior, so this new functionality is opt-in.

These layouts expose similar functionality to the ResolverLayouts with the same name, just applied to exec instead of resolver.

  • Rebase, regenerate
12978359 Update GQLgen test client to work with multipart form data (take 2) (#1661)
  • Update GQLgen test client to work with multipart form data

Update the GQLgen to support multipart form data, like those present within the fileupload examples.

  • Add missing space between "unsupported encoding " and failing content-type header error

(cherry picked from commit 101842f73fb79b10c1299bb40506080e08543ec6)

  • Add WithFiles client option for fileupload GQLgen client tests

Add a WithFiles GQLgen client option to support the fileupload input within tests, using the core Golang os package and File type, which converts os.Files to their appropriate multipart form data within a request.

  • If there are no files this should just simply convert a application/json Content-Type to supported multipart/form-data

(cherry picked from commit 08ef942416c98a2cadf61223308a3ff3c879d1c9)

  • Update fileupload test to use GQLgen test client

Update the fileupload test to use the GQLgen test client and WithFiles option to remove the need for createUploadRequest helper with raw http posts

(cherry picked from commit 5e573d51440eba9d457adb4186772577b28ef085)

  • Update WithFiles option test with multipart Reader

(cherry picked from commit 6dfa3cbe0647138e80a59a0c1d55dd9c900f96f2)

  • Update file upload tests WithFiles option

Update the file upload tests to use the GQL test client and its WithFiles option to remove the need for a custom raw HTTP post request builder createUploadRequest.

  • Also update WithFiles option to group & map identical files; e.g.

      { "0": ["variables.req.0.file", "variables.req.1.file"] }
    

(cherry picked from commit 486d9f1b2b200701f9ce6b386736a633547c1441)

  • Make sure WithFiles does not add duplicates to multipart form data

(cherry picked from commit 0c2364d8495553051d97ab805618b006fcd9eddb)

  • Fix use of byte vs string in WithFiles tests

(cherry picked from commit ba10b5b1c52a74e63e825ee57c235254e8821e0d)

  • Fix strict withFiles option test for race conditions

Fix a problem with how strict the test's expected response was for tests with files in their request, since it always expected a strict order of files input that is somewhat random or dependent on what OS it is running the test on and/or race condition

7435403c Adds RootFieldInterceptor to extension interfaces (#1647)
  • Adds RootFieldInterceptor to extension interfaces

  • Regenerates example folder

  • Re-generate after changes

  • 8b25c9e0 Add a config option to skip running "go mod tidy" on code generation (#1644)
658195b7 Revert "Update GQLgen test client to work with multipart form data (#1418)" (#1659)

This reverts commit 1318f12792e86c76a2cdff9132ebac5b3e30e148.

1318f127 Update GQLgen test client to work with multipart form data (#1418)
  • Update GQLgen test client to work with multipart form data

Update the GQLgen to support multipart form data, like those present within the fileupload examples.

  • Add missing space between "unsupported encoding " and failing content-type header error
  • Add WithFiles client option for fileupload GQLgen client tests

Add a WithFiles GQLgen client option to support the fileupload input within tests, using the core Golang os package and File type, which converts os.Files to their appropriate multipart form data within a request.

  • If there are no files this should just simply convert a application/json Content-Type to supported multipart/form-data
  • Update fileupload test to use GQLgen test client

Update the fileupload test to use the GQLgen test client and WithFiles option to remove the need for createUploadRequest helper with raw http posts

  • Update WithFiles option test with multipart Reader

  • Update file upload tests WithFiles option

Update the file upload tests to use the GQL test client and its WithFiles option to remove the need for a custom raw HTTP post request builder createUploadRequest.

  • Also update WithFiles option to group & map identical files; e.g.

      { "0": ["variables.req.0.file", "variables.req.1.file"] }
    
  • Make sure WithFiles does not add duplicates to multipart form data

  • Fix use of byte vs string in WithFiles tests

f6c35be2 Add ReplacePlugin option to replace a specific plugin (#1657)
  • Add Helper Option for replacing plugins

  • Update recipe to use ReplacePlugin instead of NoPlugin and AddPlugin

  • fix linting issue on comment

f8c46600 fix double indirect bug (#1604) (closes #1587)
  • invalid code generated

  • update code generation for pointer-to-pointer updating

bfea93cd Reload config packages after generating models (#1491)

If models are generated in a package that has already been loaded, and that package refers to another package that has already been loaded, we can find ourselves in a position where it appears that a GQL union is not satisfied.

For example, if we have:

union Subject = User

with this gqlgen.yml in github.com/wendorf/gqlgen-error/gql:

schema:
- schema.graphql
exec:
  filename: generated.go
model:

  filename: models_gen.go
models:
  User:
    model: github.com/wendorf/gqlgen-error/gql.User
  Subject:
    model: github.com/wendorf/gqlgen-error/models.Subject

Note that our User model is in the github.com/wendorf/gqlgen-error.gql package, and our models_gen.go will be generated in that same package.

When we try to run gqlgen, we get this error:

merging type systems failed: unable to bind to interface: github.com/wendorf/gqlgen-error/gql.User does not satisfy the interface github.com/wendorf/gqlgen-error/models.Subject

Digging deeper, it's because we use types.Implements in codegen/interface.go, which does a shallow object comparison. Because the type has been reloaded, it refers to a different interface type object than the one we're comparing against, and get a false negative.

By clearing the package cache and repopulating it, the whole package cache is generated at the same time, and comparisons across packages work.

To see a demo of this, check out https://github.com/wendorf/gqlgen-error and try the following:

  1. Checkout the works-with-v0.10.2 branch and go generate ./... to see that it works
  2. Checkout the breaks-with-v0.13.0 branch (or run go get to see errors
  3. Checkout the works-with-pull-request branch and go generate ./... to see that it works again. This branch adds a go.mod replace directive to use the gqlgen code in this PR.

The demo starts at v0.10.2 since it is the last release without this problem. 99designs#1020 introduces the code that fails in this scenario.

9e0817cd Add graphql schema aware field level hook to modelgen (#1650)
  • Add ast aware field level hook to modelgen

Currently, the only mechanism for extending the model generation is to use a BuildMutateHook at the end of the model generation process. This can be quite limiting as the hook only has scope of the model build and not the graphql schema which has been parsed.

This change adds a hook at the end of the field creation process which provides access to the parsed graphql type definition and field definition. This allows for more flexibility for example adding additional tags to the model based off custom directives

  • Add recipe for using the modelgen FieldMutateHook

  • fix goimport linting issue in models_test

af2ac061 handling unconventional naming used in type names (#1549)
  • handling unconventional naming used in type names

  • Fix merge resolution mistake

  • Fix merge resolution mistake

589a7742 Enable lowercase type names in GraphQL schema to properly render (#1359)

The difficulty with lowercased type names is that in go code any lowercased name is not exported. This change makes the names title case for go code while preserving the proper case when interacting with the GraphQL schema.

7081dedb Bump tmpl from 1.0.4 to 1.0.5 in /integration (#1627)

Bumps tmpl from 1.0.4 to 1.0.5.


updated-dependencies:

  • dependency-name: tmpl dependency-type: indirect ...
5287e4e5 Add QR and KVK to common initialisms (#1419)
  • Add QR and KVK to common initialisms

  • Update templates.go

  • Sort commonInitialisms

f9df1a46 Update time format for `Time` scalar (#1648)
  • Use more precise time format

  • update test

  • update docs

  • Apply suggestions from code review

  • Update scalars.md

77c757f0 Merge pull request #1640 from minus7/master

Fix example run instructions

e60dc7af Merge pull request #1619 from Khan/benkraft.mod-tidy-stdout

Forward go mod tidy stdout/stderr

0c63f1d1 Merge pull request #1515 from OpenSourceProjects/time

Marshaling & Unmarshaling time return initial value

47ce074a Fix example run instructions (closes #1607)

Making ./example a separate Go module [1] broke the go run invocations listed in a few example readmes [2]. Using relative paths from the respective example directory should be clear enough.

[2]: example/todo/server/server.go:10:2: no required module provides package github.com/99designs/gqlgen/example/todo; to add it: go get github.com/99designs/gqlgen/example/todo

d9998283 Merge pull request #1628 from robertmarsal/patch-1

Fix typo in the getting-started docs

  • f93f73ac Fix typo in the getting-started docs
2f6919ff Merge pull request #1624 from FlymeDllVa/master

Update disabling Introspection

43b56cba Forward `go mod tidy` stdout/stderr

This is a command that can fail (in my case I think for stupid reasons in a hell of my own construction, but nonetheless). Right now we just get

$ go run github.com/Khan/webapp/dev/cmd/gqlgen
tidy failed: go mod tidy failed: exit status 1
exit status 3

which is not the most informative. Now, instead, we'll forward its output to our own stdout/stderr rather than devnull.

7d549d64 Merge pull request #1617 from 99designs/update-docs-for-go1.17

Update docs for getting started

ef4d4a38 Merge pull request #1614 from 99designs/go-1.16

Also test against 1.16

473f0671 Merge pull request #1613 from 99designs/bump-non-module-deps

Clean up non-module deps

bf9b34aa Merge pull request #1612 from 99designs/update-linter

Update golangci linter

85dd47bb Merge pull request #1607 from 99designs/example-module

[POC/RFC] Split examples into separate go module

  • f93fb248 Split examples into separate go module
890f5f66 Merge pull request #1610 from 99designs/go-1.17

Update to go 1.17

  • 9162c53f Fix newlines in error messages

  • f67a5b26 Update github.com/urfave/cli/v2

1116ea6c Merge pull request #1608 from jjmengze/patch-1

fix Options response header

682a7d66 fix Options response header

operatee the header of ResponseWriter should before WriteHeader called

8f179be9 Merge pull request #1581 from tsh96/master

Bypass complexity limit on __Schema queries.

5048f992 Merge pull request #1525 from Code-Hex/fix/support-input-object

support input object directive

1e2b303a Merge pull request #1526 from epulze/fix/allow-more-types

allow more than 10 different import sources with types

e7df3e5c Merge pull request #1405 from alexsn/subsciption-complete-on-panic

subscriptions: send complete message on resolver panic

06e4fe88 Merge pull request #1529 from mathieupost/master

Return type loading errors in config.Binder.FindObject

a557c90c Merge pull request #1340 from bickyeric/master

serialize ID just like String

522cab59 Merge pull request #1285 from Khan/benkraft.federation

Resolve requests for federation entities in parallel

  • 5adb73bb add bypass __schema field test case

  • 54cef3dd Bypass complexity limit on __Schema queries.

  • f0ccab79 Return type loading errors in config.Binder.FindObject

  • 91b54787 generated go code

  • 1efc152e supported INPUT_OBJECT directive

  • e82b401d allow more than 10 different import sources with types

481a4e44 Marshaling & Unmarshaling time return initial value

There was a lack of symmetry that would prevent times for being symmetrical. That is because time.Parse actually parses an RFC3339Nano implicitly, thereby allowing nanosecond resolution on unmarshaling a time. Therefore we now marshal into nanoseconds, getting more information into GraphQL times when querying for a time, and restoring the symmetry

95653193 Resolve requests for federation entities in parallel (closes #1278)

In apollo federation, we may be asked for data about a list of entities. These can typically be resolved in parallel, just as with sibling fields in ordinary GraphQL queries. Now we do!

I also changed the behavior such that if one lookup fails, we don't cancel the others. This is more consistent with the behavior of other resolvers, and is more natural now that they execute in parallel. This, plus panic handling, required a little refactoring.

The examples probably give the clearest picture of the changes. (And the clearest test; the changed functionality is already exercised by integration-test.js as watching the test server logs will attest.)

  • f00e2c3f subscriptions: send complete message on resolver panic

  • fa371b9b serialize ID just like String

v0.14.0 - 2021-09-08

8e97969b Merge pull request #1358 from mtsmfm/patch-1

Create package declaration to run dataloaden

b978593c Merge pull request #1387 from Khan/benkraft.config

codegen/config: Add a new API to finish an already-validated config

71507dfc Merge pull request #1408 from max107/patch-1

int64 support graphql/string.go

23577b69 Merge pull request #1460 from snxk/edit-docs-recipe-gin

Edited the Gin-Gonic Recipe Docs

cecda160 Merge pull request #1464 from frederikhors/patch-1

Add goreportcard badge

  • cc957171 Merge branch 'master' into patch-1
023f66df Merge pull request #1465 from frederikhors/patch-2

Add coveralls badge

50c2028a Merge pull request #1497 from polytomic/stable-introspection

Return introspection document in stable order

a0232dd2 Merge pull request #1603 from 99designs/dependabot/npm_and_yarn/integration/normalize-url-4.5.1

Bump normalize-url from 4.5.0 to 4.5.1 in /integration

4e059eba Merge pull request #1602 from 99designs/dependabot/npm_and_yarn/integration/ini-1.3.8

Bump ini from 1.3.5 to 1.3.8 in /integration

43705d45 Merge pull request #1601 from 99designs/dependabot/npm_and_yarn/integration/y18n-3.2.2

Bump y18n from 3.2.1 to 3.2.2 in /integration

1f2465c6 Merge pull request #1600 from 99designs/dependabot/npm_and_yarn/integration/browserslist-4.17.0

Bump browserslist from 4.14.0 to 4.17.0 in /integration

bbdebd4c Merge pull request #1599 from 99designs/dependabot/npm_and_yarn/integration/hosted-git-info-2.8.9

Bump hosted-git-info from 2.8.5 to 2.8.9 in /integration

900a37af Merge pull request #1598 from 99designs/dependabot/npm_and_yarn/integration/node-fetch-2.6.1

Bump node-fetch from 2.6.0 to 2.6.1 in /integration

9d334cdd Merge pull request #1597 from 99designs/dependabot/npm_and_yarn/integration/ws-7.4.6

Bump ws from 7.3.1 to 7.4.6 in /integration

56181e8a Merge pull request #1365 from frederikhors/add-uint,-uint64,-uint32-types-in-graphql

add uint, uint64, uint32 types in graphql pkg

fd133c0b Bump normalize-url from 4.5.0 to 4.5.1 in /integration

Bumps normalize-url from 4.5.0 to 4.5.1.


updated-dependencies:

  • dependency-name: normalize-url dependency-type: indirect ...
24d8c703 Bump ini from 1.3.5 to 1.3.8 in /integration

Bumps ini from 1.3.5 to 1.3.8.


updated-dependencies:

  • dependency-name: ini dependency-type: indirect ...
de89d3a6 Bump y18n from 3.2.1 to 3.2.2 in /integration

Bumps y18n from 3.2.1 to 3.2.2.


updated-dependencies:

  • dependency-name: y18n dependency-type: indirect ...
13db6111 Bump browserslist from 4.14.0 to 4.17.0 in /integration

Bumps browserslist from 4.14.0 to 4.17.0.


updated-dependencies:

  • dependency-name: browserslist dependency-type: indirect ...
94e9406e Bump hosted-git-info from 2.8.5 to 2.8.9 in /integration

Bumps hosted-git-info from 2.8.5 to 2.8.9.


updated-dependencies:

  • dependency-name: hosted-git-info dependency-type: indirect ...
36be94ff Bump node-fetch from 2.6.0 to 2.6.1 in /integration

Bumps node-fetch from 2.6.0 to 2.6.1.


updated-dependencies:

  • dependency-name: node-fetch dependency-type: direct:development ...
721158f3 Bump ws from 7.3.1 to 7.4.6 in /integration

Bumps ws from 7.3.1 to 7.4.6.


updated-dependencies:

  • dependency-name: ws dependency-type: direct:development ...
2b3b7212 Merge pull request #1594 from 99designs/dependabot/npm_and_yarn/integration/tar-6.1.11

Bump tar from 6.0.5 to 6.1.11 in /integration

5b43833d Merge pull request #1582 from 99designs/dependabot/npm_and_yarn/integration/path-parse-1.0.7

Bump path-parse from 1.0.6 to 1.0.7 in /integration

55b028ca Merge pull request #1584 from nullism/patch-1

Fix spaces -> tabs typo in authentication.md

edf630a3 Bump tar from 6.0.5 to 6.1.11 in /integration

Bumps tar from 6.0.5 to 6.1.11.


updated-dependencies:

  • dependency-name: tar dependency-type: indirect ...
29133c11 Fix spaces -> tabs typo in authentication.md

The indentation here was supposed to be a tab rather than spaces so the readme was off.

01b25c55 Bump path-parse from 1.0.6 to 1.0.7 in /integration

Bumps path-parse from 1.0.6 to 1.0.7.


updated-dependencies:

  • dependency-name: path-parse dependency-type: indirect ...
9a214e80 Merge pull request #1451 from sanjeevchopra/patch-1

doc only change: updated sample code for disabling introspection

01197437 Merge pull request #1417 from RicCu/patch-1

Use mutation instead of query in 'Changesets' doc example

e3293b53 Merge pull request #1444 from lisowskibraeden/patch-1

Update cors.md

a4d67855 Merge pull request #1517 from ShivangGoswami/patch-1

Update apq.md function definition mismatch

eb36f04f Return introspection document in stable order

This avoids spurious changes when generating client code using something like graphql-codegen.

7e38dd46 Merge pull request #1568 from DanyHenriquez/patch-1

Update apq.md

88f2b8a7 Merge pull request #1572 from talhaguy/dataloaders-doc-casing

Correct minor casing issue

843edd9e Update apq.md function definition mismatch

line 67: cache, err := NewCache(cfg.RedisAddress, 24*time.Hour) line 41: func NewCache(redisAddress string, password string,ttl time.Duration) (*Cache, error)

either password should be removed from 41 or added in line 67 Proposed the first one for now.

5ad012e3 Revert "Merge pull request #1511 from a8m/a8m/restore-cwd"

This reverts commit f4bf1f591b6a3884041876deb64ce0dd70c3c883, reversing changes made to 3f68ea27a1a9fea2064caf877f7e24d00aa439e6.

Reverting this because it will break existing setups, moving where generated files get put.

bf2fdf44 Merge pull request #1514 from 99designs/bump-gqlparser

Bump gqlparser to v2.2.0

  • 4e881981 Bump to gqlparser v2.2.0

  • 1d768a29 Add test covering single element -> slice coercion

  • f57d1a02 Bump gqlparser to master & support repeated directives

f4bf1f59 Merge pull request #1511 from a8m/a8m/restore-cwd

codegen/config: restore current working directory after changing it

c920bdeb Merge pull request #1449 from steebchen/feat-prisma-compat

feat(codegen): handle (v, ok) methods

3cfc5b14 codegen/config: restore current working directory after changing it

Before this commit, a call to config.LoadConfigFromDefaultLocations changed the working directory to the directory that contains the gqlgen config file.

This commit changes the implementation to restore the working directory after loading the config.

35b80a72 Merge pull request #1495 from Niennienzz/improve-apq-doc

Update apq.md

463debae Merge pull request #1503 from nana4gonta/resolve-vulnerability

Resolve indirect dependency vulnerability in example

29e7bccb Merge pull request #1501 from 99designs/fix-init-1.16

Run go mod tidy after code generation

9a4c80ab Merge pull request #1502 from 99designs/rm-chi

Remove chi from dataloader example

52ded951 Merge pull request #1459 from aaronArinder/getting-started-server-section

getting started: make running server own section

7258af5f Merge pull request #1458 from aaronArinder/getting-started-wording

getting started: making the resolver fn section clearer

4fead489 Merge pull request #1452 from fmyd/fix/formatted-query-indent

prettified some indentation

58e3225e Merge pull request #1480 from wilhelmeek/double-bubble

Bubble Null from List Element to Nearest Nullable Ancestor

18678b15 Fix data race

The argument of unmarshalInput may be the same for concurrent use if it pass as graphql "variables". So we have to copy it before setting default values

  • 02b14003 fomatted query indent

  • 0e9d9c3a updated sample code for disabling introspection

  • 478c3f08 feat(codegen): handle (v, ok) methods

5ef5d14f Update cors.md

I had problems reading this page and applying it to my project. With these changes it worked on my end

997da421 Merge pull request #1436 from ddouglas/patch-1

Upgrade graphql-playground to 1.7.26

  • be4514c6 Upgrade graphql-playground to 1.7.26

  • 918801ea Change 'Changeset' doc example to mutation

862762c7 Merge pull request #1409 from zikaeroh/chi-mod

Upgrade go-chi to v1.5.1 with module support

b484fc27 Merge pull request #1401 from oseifrimpong/patch-1

fix typo

4cc031af Merge pull request #1394 from j2gg0s/fix-default-recover-func

bugfix: Default Recover func should return gqlerror.Error

2af51336 Merge pull request #1400 from 99designs/sanstale

Remove stale bot

34a442c7 Merge pull request #1399 from 99designs/prevent-possible-error-deadlock

Dont hold error lock when calling into error presenters

1123ba0d Update gin.md

Changed this: In your router file, define the handlers for the GraphQL and Playground endpoints in two different methods and tie then together in the Gin router: to: In your router file, define the handlers for the GraphQL and Playground endpoints in two different methods and tie them together in the Gin router:

89a9f743 Remove stale bot

We tried it, but it's just causing more work both for maintainers and reporters of errors.

4628ef84 Dont hold error lock when calling into error presenters

This can result in a deadlock if error handling code calls GetErrors.

  • d0d5f7db bugfix: Default Recover func should return gqlerror.Error
18b5df19 codegen/config: Add a new API to finish an already-validated config

LoadConfig parses the config from yaml, but it does a bunch of other things too. We want to parse the config ourselves, so that we can have extra fields which will be passed to our plugins. Right now, that means we either have to duplicate all of LoadConfig, or write the config back to disk only to ask gqlgen re-parse it.

In this commit, I expose a new function that does all the parts of LoadConfig other than the actual YAML-reading: that way, a caller who wants to parse the YAML themselves (or otherwise programmatically compute the config) can do so without having to write it back to disk.

An alternative would be to move all this logic to Config.Init(), but that could break existing clients. Either way would work for us.

0e12bfbf Merge pull request #1269 from dqn/new-line-at-the-end-of-file

Add a new line to end of the file schema.graphqls

22c5d1f5 Merge pull request #1303 from kunalpowar/inline-directives-doc

Update README.md

88cffee4 Merge pull request #1356 from maapteh/chore/chat-example-update

Chore: update Chat example

de8af66c Merge pull request #1360 from Captain-K-101/master

Update introspection.md

651eda40 Merge pull request #1374 from rudylee/docs-file-upload-small-typo

Fix small typo in file upload docs

  • 94252e04 singleUpload consistency

  • c9d346f5 Fix small typo in file upload docs

  • 9f851619 add uint, uint64, uint32 types in graphql

0625525f Update introspection.md

updated disabling interospect

  • c6a93aa7 split layout components to their own part, makes sample more readable

  • 7904ef6f channel is switchable too

  • 13752055 add some layout for demo :)

82ca6e24 Create package declaration to run dataloaden

ref: vektah/dataloaden#35

  • bf549136 use Apollo docs styling for the gql var uppercase

  • 36045a37 do not autofocus

  • 0502228a chore: update example to React hooks and latest Apollo client

  • e6e64224 update deps

3a31a752 Merge pull request #1345 from abeltay/fix-alignment

Fix tab spacing in cors.md

0c68337c Merge pull request #1346 from abeltay/fix-typo

Fix typo in migration guide

819e751c Merge pull request #1341 from dgraph-io/rajas/fix-gqlgen-1299

Rajas/fix gqlgen 1299

v0.13.0 - 2020-09-21

  • 07c1f93b release v0.13.0

  • 259f2711 Bump to gqlparser to v2.1.0 Error unwrapping release

669a1668 Merge pull request #1312 from 99designs/error-wrapping

Always wrap user errors

9b948a5f Merge pull request #1316 from skaji/is-resolver

Add IsResolver to FieldContext

e821b97b Always wrap user errors (closes #1305)

Requires use of go 1.13 error unwrapping.

On measure I think I prefer this approach, even though it's a bigger BC break:

  • There's less mutex juggling
  • It has never felt right to me that we make the user deal with path when overriding the error presenter
  • The default error presenter is now incredibly simple

Questions:

  • Are we comfortable with supporting 1.13 and up?
  • Should we change the signature of ErrorPresenterFunc to func(ctx context.Context, err *gqlerror.Error) *gqlerror.Error?
    • It always is now, and breaking BC will force users to address the requirement for errors.As
51b580de Merge pull request #1324 from bemasher/patch-1

Fix typos in README.md

622316e7 Merge pull request #1295 from a-oz/a-oz-patch-1

Update getting-started.md

4c11d9fa Update getting-started.md

fix typo

v0.12.2 - 2020-08-18

e3ce560d Merge pull request #1288 from alexsn/nopath-field-noerror

avoid computing field path when getting field errors

108975c3 Merge pull request #1284 from dgraph-io/jatin/sameFieldSameTypeGettingIgnored

fix same field name in two different fragments

eb424a22 Merge pull request #1294 from 99designs/fix-init

Allow rewriter to work on empty but potentially importable packages

v0.12.1 - 2020-08-14

v0.12.0 - 2020-08-14

3b633dfa Merge pull request #1267 from ImKcat/master

Fixed transport not support issue

c9a27ae3 Merge pull request #1255 from s-ichikawa/fix-object-directive-bug

Fix bug about OBJECT directive

e9863af1 Merge pull request #1276 from Ghvstcode/master

Documentation Fixes

04f6a691 Merge pull request #1277 from 99designs/direct-pointer-binding

Support pointers in un/marshal functions

  • bef9c8bf Add comments and docs for pointer scalars
997efd03 Reintroduce special cast case for string enums

This reverts commit 89960664d05f0e93ed629a22753b9e30ced2698f.

  • 8561c056 Replace awkward loop in buildTypes with recursion

  • d65b04f9 Clean up generated code

  • e1c463a4 Linting

  • 89960664 Remove unused special cast case for string enums

  • 196954bc Bind directly to pointer types when possible, instead of always binding to value types

  • 5b3d08db Update README.md

  • efd33dab Update README.md

  • f35b162f Fixed transport not support issue

39a12e0f Merge pull request #1134 from seriousben/fix-default-config-no-ast-sources

Add LoadDefaultConfig to load the schema by default

1b23cf15 Merge pull request #1264 from 99designs/go-1.14

Target multiple go versions for CI

ce964c1f Merge pull request #1115 from bowd/add-input-path-for-unmarshaling

Add input path in unmarshaling errors

  • bde4291c shadow context to ensure scoped context use

  • c43990a0 Merge remote-tracking branch 'origin/master' into HEAD

  • 6be2e9df fix fileupload example

ad675f00 Allow custom resolver filenames using `filename_template` option (closes #1085)

resolve merge conflicts.

  • fbfdd41c Merge pull request #1262 from sateeshpnv/gqlparser-alias (closes #1258)

  • 99fafc9f [issue #1258] explicitly add gqlparser alias to vektah/gqlparser/v2 import

  • 49291f23 fix bug in OBJECT directive

0fbf293f Merge pull request #1248 from sotoslammer/master

close the connection when run returns

d7eabafb Merge pull request #1246 from arkhvoid/master

Fix typo cause memory problem on upload

  • 21b223b8 Fix typo cause memory problem on upload

  • cc9c520f close the connection when run returns

8494028e Merge pull request #1243 from 99designs/nilable-nullable-unnmarshal

Remove a bunch of unneeded nil checks from non-nullable graphql type unmarshalling

  • b81138da Add test for nillable input slice

  • 14d1a4dc Only return nil for nilable types when the graphql spec would allow it

3e59a10d Merge pull request #1215 from ddouglas/master

Adding Missing Header to response

1650c499 Merge pull request #1242 from 99designs/named_map_references

Do not use pointers on named map types

  • d11f6021 Do not use pointers on named map types
acaee361 Merge pull request #1121 from Khan/extern-only

Do not require a resolver for "empty" extended types.

555db6d2 Merge pull request #1224 from frederikhors/patch-1

Indentation misprint

a3c38c65 Merge pull request #1221 from longngn/patch-1

Update dataloaders.md

d81baeed Merge pull request #1218 from StevenACoffman/patch-1

Update feature comparison for federation

  • 2c1f2345 Update feature comparison for federation (closes #5)

  • e19d43bc Adding test

  • 4a62f012 Adding ContentType header to GET request responses

  • f5de4731 Add timeout to integration test

a21a6633 Merge pull request #1189 from RichardLindhout/patch-1

Upgrade to OperationContext and remove duplicate fields to fix https:…

543317a2 Merge pull request #1170 from alexsn/apollotracing/nopanic

apollotracing: skip field interceptor when on no tracing extension

032854bb Merge pull request #1154 from gsgalloway/master

Add operation context when dispatching

ccc4eb1d Merge pull request #1188 from k-yomo/update-errors-doc

Update outdated examples in errors doc

628b83c1 Merge pull request #1198 from ddevault/pgp

codegen: add PGP to common initialisms

d881559b Merge pull request #1202 from whereswaldon/patch-1

doc: fix typo in embedded struct example

b6ce42a7 Merge pull request #1207 from k-yomo/update-gorilla-websocket

Update gorilla/websocket to v1.4.2 to resolve vulnerability

  • c5bfe9d3 Update gorilla/websocket to v1.4.2 to resolve vulnerability

  • 55c16e93 doc: fix typo in embedded struct example

  • 89eb1993 codegen: add PGP to common initialisms

  • 9ab7294d apollotracing: skip field interceptor when on no tracing extension

40570d1b Merge pull request #1163 from fwojciec/master

fix redundant type warning

3f7f60bf Merge pull request #1181 from tmc/patch-1

Update getting-started.md

0a404813 Merge pull request #1117 from s-ichikawa/object-directive

Add support for OBJECT directive

90ee8ded Merge pull request #1137 from ddevault/master

Replace ~ with א in package names

e4c699dc Merge pull request #1147 from ddevault/docs

Add links to godoc to the README and docsite

73746621 Merge pull request #1131 from muraoka/fix-typo

Fix typo in authentication docs

ace558b4 Merge pull request #1124 from OpenSourceProjects/update-apq-documentation

Update APQ example to reflect newer API

3c126f9e Merge pull request #1119 from skaji/patch-1

type Person -> type Person struct

04b120c9 Update APQ example to reflect newer API

The example in APQ relates to the old handlers. This brings it up to show how extensions can be used - and uses the new API for registering plugins that come in the graph.

The cache example now implements the graphql.Cache interface

  • 55e0f0db Check in a place where Entity might be nil now.
1ecd0749 Handle the case that all entities are "empty extend".

In that case, there are no resolvers to write, so we shouldn't emit any.

36b5ed83 Actually, we need to check all-external, not all-key.

We might well be defining our own type that has only key-fields, but if they're not external then we're the primary provider of the type

Test plan: go test ./plugin/federation/

7e3f5844 Do not require a resolver for "empty" extended types.

Summary: If our schema has a field with a type defined in another service, then we need to define an "empty extend" of that type in this service, so this service knows what the type is like. But the graphql-server will never ask us to actually resolve this "empty extend", so we don't require a resolver function for it. Example:

   type MyType {
      myvar: TypeDefinedInOtherService
   }

   // Federation needs this type, but it doesn't need a resolver for
   // it!  graphql-server will never ask *us* to resolve a
   // TypeDefinedInOtherService; it will ask the other service.
   extend TypeDefinedInOtherService @key(fields: "id") {
      id: ID @extends
   }

Test Plan: I manually tested this on a service (assignments) that we have that fell afoul of this problem. But I had a hard time adding tests inside gqlgen because the error happens at validation-time, and the federation tests are not set up to go that far down the processing path.

Reviewers: benkraft, lizfaubell, dhruv

Subscribers: #graphql

Differential Revision: https://phabricator.khanacademy.org/D61883

  • 9c80bb5b type Person -> type Person struct

  • ea210929 add test for object directive

  • 5c3812cb merge object directives to field directives

  • 8ea5ba2b Fix additional missed tests

  • 65be2a6e Run generate

  • fd615cf6 Fix linting

  • 61fa9903 Add documentation for scalad error handling

  • 1aa20f25 Add test to highlight usecase

  • d98ff1b0 Modify templates to include deeper context nesting

a1a02615 Merge pull request #1104 from oshalygin/docs/update-query-complexity-initialization

Update Query Complexity Documentation

c68df3c6 Merge pull request #1112 from s-ichikawa/delete-unused-code

delete unused code

dfb6558a run CI on PRs

PRs from outside the org arent running CI, hopefully this fixes it.

6f81ff92 Update Query Complexity Documentation
  • This pass at the documentation updates the appropriate section regarding query complexity, specifically in the way that the http.Handler is created.
  • The deprecated handler.GraphQL calls were replaced with NewDefaultServer.
  • Instead of passing along the fixed query complexity as a second argument to the now deprecated handler.GraphQL func, extension.FixedComplexityLimit is used instead.
  • f0cd7a70 update doc site to point to latest version

  • 224ff345 v0.11.3 postrelease bump

v0.11.3 - 2020-03-13

  • 4d735356 release v0.11.3

  • 4b949f2e remove copyright notice at bottom of doc pages

c5039196 Merge pull request #1094 from 99designs/update-upload-docs

Update file upload docs with Apollo client usage

793b0672 Merge pull request #1100 from sonatard/fast

Gnerate to fast by exec codegen.GenerateCode before plugin GenerateCode

6ac2d1cd Merge pull request #1097 from 86/86/update-federation-doc

Add Enable federation section in federation doc

  • 97896eeb exec codegen.GenerateCode before plugin GenerateCode to fast

  • 44f8ba9f Update licence

  • 94701fb7 add Enable federation section in federation doc

  • 64190309 Update upload docs with Apollo usage

  • a5381191 v0.11.2 postrelease bump

v0.11.2 - 2020-03-05

78f3da22 Merge pull request #1050 from technoweenie/executor

Executor

42eff5a9 Merge pull request #1057 from RichardLindhout/master

Upgrade to github.com/urfave/cli/v2

bb5cb8a3 Merge pull request #1086 from 99designs/github-actions

Use GitHub Actions

587bc81c Merge pull request #1074 from yudppp/feature/add_contenttype_for_upload

Add ContentType to graphql.Upload

  • a84d6577 graphql/handler: revive the existing around func types

  • f9bb017b graphql/executor_test: ensure operation trace is started before every query

  • 57dd8d9c graphql/gqlgen: remove unnecessary convenience method

  • fb86f7b9 graphql/executor: remove the naked return

  • 9ae6bc0b graphql/executor: reinit all extension values on every Use() call

  • f3909a8a graphql/executor: make ext funcs private

  • df9e7ce3 Run CI on push only

  • ed76bc92 Update badge

  • 5a1a5446 Coveralls fixes

  • 41acc753 Fix windows line endings

  • 390cea4f Replace Appveyor with Github Actions

  • 85be072f Replace CircleCI with Github Actions

  • 8d540db3 fix: Add Upload.ContentType test

  • f21832af fix: Fixed Upload type document

b165568c Merge pull request #1071 from kandros/fix-server-path

fix server path

9d7648aa Merge pull request #1072 from wtask/patch-1

Fix a typo in sql example

24400c9b Merge pull request #1079 from sonatard/remove-unused

Remove unused code

a7c79891 Merge pull request #1081 from sonatard/fix-plugin-test

Fix unlink file path in resolvergen test

e7bf7548 Merge pull request #1080 from sonatard/fix-testdata

Fix test data

f0ebc0df Fix a typo in sql example

I think todo is referenced to user by user_id field, not by todo.id

b788cce5 Merge pull request #1054 from 99designs/golint-free-resolvers

suppress golint messages

c515d403 Merge pull request #1053 from RichardLindhout/patch-3

Add practical example of getting all the requested fields

e57cd445 Merge pull request #1061 from halvdan/patch-1

Fix mismatching documentation of Todo struct

1388fa94 Fix mismatching documentation of Todo struct

Mismatch between the code and the getting started documentation.

24813079 Add practical example of getting all the requested fields

Based on this 99designs#954 was tagged as 'need documentation'

a53ce377 Merge pull request #1051 from 99designs/has-operation-context

Add function to check presense of operation context

  • 95e453bf Add function to check presense of operation context

  • 36365c41 graphql/executor: move setExtensions()

  • 3acc9421 graphql/executor: ensure Executor implements graphql.GraphExecutor.

  • f89b973b graphql/executor: merge ExtensionList into Executor

  • c16a77c3 graphql/handler: replace internal executor type

  • 8fa26cec graphql/executor: extract an Executor type from graphql/handler

  • d5d780c5 Point latest docs to 0.11.1

  • abaa0a04 v0.11.1 postrelease bump

v0.11.1 - 2020-02-19

bc07188c Merge pull request #1038 from 99designs/feat-check-len

check slice length

07a13861 Merge pull request #1043 from 99designs/ensure-panic-handlers-get-applied

Ensure panic handlers get applied

156d306d Merge pull request #1046 from appleboy/patch

docs(gin): missing import playground

25d16761 Merge pull request #1039 from VitaliiLakusta/patch-1

Fix link to examples directory in Federation docs

  • 4c47ad16 Fix link to examples directory in Federation docs

  • 2506dce0 check slice len

  • 1a68df34 fix origin/master reference in switcher

  • 199cfedf remove old docs that no longer run with new layout

  • 556c8484 fix paths

  • 282100c8 use current layout to build old doc content

  • 4c38b8b4 v0.11.0 postrelease bump

v0.11.0 - 2020-02-17

e65d6228 Merge pull request #1036 from 99designs/update-v011-docs

Update 0.11 migration docs

2b3eed30 Merge pull request #1034 from 99designs/strip-underscores-from-entity-interfaces

Trim underscores from around go identifiers

7cac3610 Merge pull request #1027 from sonatard/response-errors

propagate resolver errors to response error in ResponseMiddleware

14dccc57 Merge pull request #1022 from 99designs/feat-gqlparser-117

example about apply vektah/gqlparser#117

4ece3857 Merge pull request #1028 from abhimanyusinghgaur/master

Respect includeDeprecated for EnumValues

30e23757 Merge pull request #1020 from 99designs/handle-interfaces-implementing-interfaces

Handle interfaces that implement interfaces

  • b7a58a1c Handle interfaces that implement interfaces
ab8d62b6 Merge pull request #1019 from 99designs/remove-source-reprinting

Remove source reprinting

e289aaa0 Merge pull request #1018 from 99designs/federation-docs

Federation docs and examples

656a07d1 Merge pull request #1016 from 99designs/federation-entity-type

Create a non generated federation _Entity type

  • 8850a527 Create a non generated federation _Entity type
1d41c2eb Merge pull request #1012 from 99designs/federation-config

Allow configuring the federation output file location

afa9a150 Merge pull request #1013 from 99designs/feat-error-dispatch

propagate errors to response context in DispatchError

  • 652aa2fb propagate errors to response context in DispatchError
0fe1af8c Merge pull request #1011 from Khan/compound-keys

Compound key support in federation

  • ad3c1c81 Allow configuring the federation output file location
b4a00e6c Merge pull request #1010 from Khan/query-exists

Make sure there's a Query node before trying to add a field to it.

65401637 Adding type with multiple keys to federation test

Summary: The current federation test schema only has types with single keys (or no keys). Adding a type with multiple keys, including one non-String key, to test compound key federation code gen.

Test Plan: - go test

Reviewers: csilvers, miguel

Differential Revision: https://phabricator.khanacademy.org/D60715

3f714a46 Extending federation to support compound keys per Apollo spec

Summary: Compound keys are not yet supported for federation in gqlgen. This diff adds support by modifying the federation plugin to handle a list of key fields on an entity rather than a single top-level key field. It will now look for "findBy..." in the resolver, rather than the original "FindBy". The federation plugin does not yet support more complicated FieldSets in the key, such as nested selections.

References:

Will update https://phabricator.khanacademy.org/D59469 with multiple key changes.

Test Plan:

  • Tested Go GQL services using both single- and multiple-key federated types (assignments and content-library in webapp/services)
  • Ran gqlgen on non-federated services in webapp to ensure regular generation still works (donations service)
  • WIP: creating unit tests; will submit as separate diff

Reviewers: briangenisio, dhruv, csilvers, O4 go-vernors

Reviewed By: dhruv, csilvers, O4 go-vernors

Differential Revision: https://phabricator.khanacademy.org/D59569

9f2a624b Make sure there's a Query node before trying to add a field to it.

Federation adds some queries to the schema. There already existed code to insert a Query node if none existed previously. But that code was only put on addEntityToSchema(), and not the other place we update the query, addServiceToSchema().

Almost always the old code was good enough, since we call addEntityToSchema() before addServiceToSchema(). But there's on addServiceToSchema(), so we need to do the query-existence check there too.

b941b970 Merge pull request #1007 from 99designs/handle-invalid-autoload-path

Give an appropriate error message when autoload isnt a valid package

  • 95b10809 bump appveyor go version for consistent behavour

  • 91a9ff97 fix bad copy from template

  • d5d6f830 Give an appropriate error message when autoload isnt a valid package

f7667e12 Merge pull request #1009 from 99designs/interface-regression

Interface regression

  • ffc419f3 Fix interfaces used as normal object types

  • 44cfb926 Test example for interface regression

0ddb3ef3 Merge pull request #1006 from ravisastryk/entity-directives-lookup

skip searching directives when entity is found

  • 395e1d73 skip searching directives when entity is found

  • e1f2282e bump to go 1.13 in ci

34c92eba Merge pull request #1003 from 99designs/fix-chat-example

fix chat example

8ed2ec59 Merge pull request #988 from 99designs/package-cache

Cache all packages.Load calls in a central object

  • 9ccd7ed7 Cache all packages.Load calls in a central object
565619a8 Merge pull request #993 from 99designs/resolver-generator-v2

Resolver regenerator

  • cf4a3eb4 keep imports when scattering resolvers between files

  • da7c1e45 Update getting started docs

  • c233876e fix windows test paths

  • 93713a29 Add tests for code persistence

  • 3e507e0d separate resolver stubs by 1 empty line

  • 8a208af5 add tests covering ResolverConfig

  • f8e61961 set init to use new resolvers by default

  • dbaf355d copy through any unknown data

  • e7255580 copy old imports through before gofmt prunes

  • 6ec36504 Copy existing resolver bodies when regenerating new resolvers

  • 9e3b399d add resolver layout = follow-schema

  • 8a18895e Update to latest golangci-lint

  • f7a67722 Merge pull request #985 from Khan/no-key-needed

fa884991 Correctly generate a federated schema when no entity has a `[@key](https://github.com/key)`.

Normally, when a service is taking part in graphql federation, it will services can link to (that is, have an edge pointing to) the type that this service provides. The previous federation code assumed that was the case.

types. It might seem that would mean the service is unreachable, since there is no possibility of edges into the service, but there are and top level Mutation edges. That is, if a service only provides a top-level query or top-level mutation, it might not need to define a

This commit updates the federation code to support that use case.

36aae4aa Merge pull request #994 from 99designs/feat-cache-ctx

Add context.Context to graphql.Cache interface's methods

61e060bd Merge pull request #995 from alexsn/directiveroot_empty_lines

Remove empty lines on DirectiveRoot generation

  • 30c295c4 Remove empty lines on DirectiveRoot generation

  • 85cfa8a3 Add context.Context to graphql.Cache interface's methods

a6c7aafb Merge pull request #931 from fridolin-koch/master

Fix for Panic if only interfaces shall be generated

ec4f6b15 Merge pull request #989 from 99designs/fix-intermittent-test-ka-failure

Fix intermittent websocket ka test failure

  • 76035df5 Fix intermittent websocket ka test failure
aa407b1f Merge pull request #979 from 99designs/capture-read-times

Capture read times

  • 4dd10086 fix test race by only stubbing now where we need to

  • 8dbce3cf Capture the time spent reading requests from the client

c6b3e2a1 Merge pull request #983 from vikstrous/name-for-package-global

single packages.Load for NameForPackage

ae79e75b Merge pull request #978 from 99designs/pluggable-error-code

Allow customizing http and websocket status codes for errors

  • 7f6f1667 bump x/tools for consistent import formatting

  • 842fcc11 review feedback

  • f0bea5ff Allow customizing http and websocket status codes for errors

  • bd50bbcb single packages.Load for NameForPackage

28c032d1 Merge pull request #982 from DavidJFelix/patch-1

fix: explicitly exclude trailing comma from link

ac67050a fix: explicitly exclude trailing comma from link
  • this looks dumb, but when the page is rendered, the link resolves with the comma, despite the comma being excluded in github rendering.
8218c734 Merge pull request #851 from marwan-at-work/federation

Apollo Federation MVP

0eef2fe2 Merge pull request #970 from spiffyjr/master

Fix extra trimspace on nillable Unmarshals

56b8eef2 Merge pull request #974 from oshalygin/docs/gqlgen-pg-example-repo

Add Link to Sample Project with GQLGen and Postgres

f49936eb Add Link to Sample Project with GQLGen and Postgres

This is a very straightforward project with numerous details in the README and the official documentation, but questions continue to pop up around how to use this project, organize the files and ultimately make data calls to some persistent layer.

The https://github.com/oshalygin/gqlgen-pg-todo-example was built in order to show newcomers the following:

  • How to organize their graphql schema, resolvers, dataloaders and models
  • How to create a new dataloader
  • How to resolve with a dataloader and how to avoid some of the pitfalls(inconsistent db query to keys array order)
  • How to map models from a gql schema to structs

While the examples in this project are helpful, they could benefit from more elaborate explanations in the code as well as the README to help newcomers get started. This PR is not intended to portray any of the examples negatively and should not be interpreted as such. There are many findings/lessons learned from the work that folks put together in those examples.

README which covers a ton of the details on how to use this project:

412a72fe Merge pull request #885 from 99designs/handler-refactor

Refactor handler package

5106480b Merge pull request #947 from 99designs/handler-oc-handling

always return OperationContext for postpone process

  • 922db1e3 always return OperationContext for postpone process

  • 8794f03e v0.10.2 postrelease bump

  • 14dbf1aa use new handler package in new test

  • a339a042 panic if operation context is missing when requested

  • a13a0f5f add docs on extension name conventions

  • 458fa0de Add more interface assertions

  • d0836b72 Expose APQ stats

  • cf14cf10 fix: Fix no code generation for only interfaces

  • dc76d029 Merge remote-tracking branch 'origin/master' into handler-refactor

  • 572fb419 remove all references to deprecated handler package

  • dc622346 Tune allocs for benchmarks

  • a6f94626 Merge remote-tracking branch 'origin/master' into handler-refactor

  • c3f93810 fix benchmark

  • 631b48a5 remove automatic field stat collection to reduce time calls

  • a77d9fc2 Add generated stanzas back in

  • 0ee185b8 fix duplicate header sends

  • 7cbd75db fix APQ signature

  • 67fa2104 allow extensions to declare their own stats

  • e9502ae0 Make extensions validatable

  • fc727c9c Add a signpost method to handler extension interface

  • 0a39ae20 add fixed complexity limit

  • f2ef5ec3 more deprecations and more compat

  • 2898a622 rename ResolverContext to FieldContext

  • 092ed95f collect field timing in generated code

  • 848c627c remove DirectiveMiddleware

  • 40f08868 add NewDefaultServer

  • 1b57bc3e Rename RequestContext to OperationContext

  • 3476ac44 fix linting issues

  • 479abbef update generated code

  • bc981569 Combine root handlers in ExecutableSchema into a single Exec method

  • 473a0d25 Implement bc shim for old handler package

  • 631142cf move writer all the way back to the transport

  • c7bb03a8 merge executable schema entrypoints

  • e7e913d9 Remove remains of old handler package

  • 8c5340c1 Add complexity limit plugin

  • 0965420a Add query document caching

  • aede7d1c Add multipart from transport

  • 64cfc9ad extract shared handler test server stubs

  • a70e93bc consistently name transports

  • 9d1d77e6 split context.go into 3 files

  • 72c47c98 rename result handler to response handler

  • 4a69bcd0 Bring operation middleware inline with other handler interfaces

  • ab5665ad Add result context

  • c3dbcf83 Add apollo tracing

  • f00e5fa0 use plugins instead of middleware so multiple hooks can be configured

  • a7c5e660 build middleware graph once at startup

  • 2e0c9cab mark validation and parse errors separately to execution errors

  • cb99b42e Add websocket transport

  • eed1515c Split middlware out of handler package

  • b5089cac Split transports into subpackage

  • d0f68303 port json post

  • afe241b5 port over tracing

  • 311887d6 convert APQ to middleware

  • da986181 port over the setter request context middleware

  • 249b602d Start drafting new handler interfaces

v0.10.2 - 2019-11-28

9e989d94 Merge pull request #929 from nmaquet/check-nil-interface-ptrs

Don't crash when interface resolver returns a typed nil

6f20101c Merge pull request #940 from vikstrous/optional-modelgen

make model generation optional

9b9dd562 Merge pull request #942 from vikstrous/disable-validation

add skip_validation flag

f9f2063a Merge pull request #941 from vikstrous/qualify-package-path-faster

shortcut QualifyPackagePath in go module mode

d3f63844 Merge pull request #939 from mjarkk/patch-1

(docs) graph-gophers now supports Struct Field resolving

  • ba3d0189 graph-gophers now supports Struct Field resolvers
e747d923 Merge pull request #938 from lulucas/master

modelgen hook docs fixed

63be1d5e Merge pull request #1 from lulucas/modelgen-hook-patch-1

modelgen hook docs use plugin poitner

33fc16b1 modelgen hook docs use plugin poitner

and add modelgen package to ModelBuild type

59946087 Add unit test for the interface resolver / typed nil interaction

This added test shows that the _Dog_species automatically generated resolver will crash unless the extra nil check is added in interface.gotpl.

85ca9efe Return graphql.Null in interface resolver when passed a typed nil

Go's dreaded typed nil strikes again. Nil pointers of struct types aren't equal to nil interface pointers.

See https://golang.org/doc/faq#nil_error

15b30588 Merge pull request #894 from 99designs/enum-var-value-coercion

Improve enum value (with vars) validation timing

  • 568433a2 fix ci failed

  • 0ccfc7e0 Merge branch 'master' into enum-var-value-coercion

9cfd817e Merge pull request #897 from mskrip/modelgen-hook

Add possibility to hook into modelgen plugin

fd201a8c Update UniquenessKey for when Element is/isn't nullable (#896)

With a schema: type Query { things1: [Thing] # Note the lack of "!" }

type Subscription { things2: [Thing!] # Note the "!" }

the UniquenessKey for the two lists is the same, which causes non-deterministic output.

  • 2a269dd3 Add modelgen hook recipe

  • 6ceb76b6 Test tag generation only by looking up extected tag strings

1f272d1b Add possibility to hook into modelgen plugin (closes #876)

This change introduces option to implement custom hook for model generation plugin without the need to completly copy the whole modelgen plugin.

that can be:

func mutateHook(b *ModelBuild) *ModelBuild {
	for _, model := range b.Models {
		for _, field := range model.Fields {
			field.Tag += ` orm_binding:"` + model.Name + `.`  +  field.Name + `"`
		}
	}

	return b
}

...

func main() {
    p := modelgen.Plugin {
        MutateHook: mutateHook,
    }

    ...
}
99a55da2 Merge pull request #927 from matiasanaya/feature/bind-to-embedded-interface

Bind to embedded interface

  • 70e860cc Bind to embedded interface method

  • a745dc78 Fixes #843: Bind to embedded struct method or field

f80cab06 Merge pull request #923 from 99designs/gqlparser-1.2.0

Update to gqlparser-1.2.0

7653a681 Merge pull request #916 from karthikraobr/patch-1

3->4 scalars

8faa0e3a Merge pull request #917 from colelawrence/patch-1

docs: Fix typo in title of "Resolvers"

1172128c Merge pull request #904 from cfilby/fix-config-docs

Minor Documentation Tweaks

adbceeea Merge pull request #902 from cfilby/fix-int64-marshalling

Add support for int64 IDs

dbc88428 Merge pull request #889 from thnt/fix-init-with-schema-arg

fix init not use custom schema filename

4c35356c Merge pull request #883 from 99designs/handle-invalid-types

Gracefully handle invalid types from invalid go packages

  • 25b70271 Gracefully handle invalid types from invalid go packages
046054db Merge pull request #882 from 99designs/testserver-autobind

Use autobinding in testserver

  • 12c963a4 Use autobinding in testserver
305116a0 Merge pull request #879 from coderste/patch-1

Fixed broken GitHub link within the APQ page

b4867b3f Fixed broken GitHub link within the APQ page

Small documentation change to fix a broken GitHub link.

v0.10.1 - 2019-09-25

955f3499 Merge pull request #877 from 99designs/fix-websocket-client

Fix websocket connections on test client

  • ef24a1cc Fix websocket connections on test client

  • c997ec0c v0.10.0 postrelease bump

v0.10.0 - 2019-09-24

0bc3cc86 Merge pull request #875 from 99designs/fix-clientwide-opts

Fix client global options

b43edf5d Merge pull request #874 from 99designs/configurable-slice-element-pointers

Add config option to omit pointers to slice elements

  • 921aa9cf Fix client global options

  • d0098e60 Add config option to omit pointers to slice elements

01893280 Merge pull request #819 from 99designs/fix-directive-interface-nils

Fix directives returning nils from optional interfaces

  • 34d10975 Fix directives returning nils from optional interfaces
eea38e55 Merge pull request #862 from qhenkart/fixes-shareable-link-setting

fixes shareable link button in playground

b5e78342 Merge pull request #870 from 99designs/ws-init-ctx

Allow changing context in websocket init func

034aa627 Merge pull request #871 from 99designs/subscription-middleware

Call middleware and directives for subscriptions

7b41ca3c Merge pull request #872 from 99designs/autobind-prefix

Allow prefixes when using autobind

de8e559f Merge pull request #854 from wabain/nested-map-interface

Fix for nested fields backed by map or interface

cc64f331 Merge pull request #828 from 99designs/feat-rc

introduce RequestContext#Validate and use it instead of NewRequestContext function

  • ed2a8536 Allow prefixes when using autobind

  • 819cc71b Call middleware and directives for subscriptions

  • 5a7c5903 Allow changing context in websocket init func

17f32d28 Merge pull request #861 from 99designs/refactor-test-client

Refactor test client

ed14cf04 Update playground.go

fix formatting

ee8d7a17 Update playground.go

fix formatting

7e643fdc Merge pull request #838 from 99designs/fix-directive-nil

fix directives return nil handling

  • f33e09e8 Merge branch 'master' into fix-directive-nil
8590edef Merge pull request #839 from 99designs/fix-nil-directive

refactor unimplemented directive handling

  • 1f7ed0d5 refactor unimplemented directive handling

  • 94ad3f2e fix directives return nil handling

  • 5c644a6f v0.9.3 postrelease bump

  • 82758be8 fix error

  • edde2d03 add OperationName field to RequestContext

  • 830e466e introduce RequestContext#Validate and use it instead of NewRequestContext function

v0.9.3 - 2019-08-16

fc02cfe8 Merge pull request #829 from 99designs/fix-2directives

fix go syntax issue when field has 2 directives

924f620c Merge pull request #831 from yudppp/patch-1

Fixed scalar reference documentation

  • ca4cc732 Fixed scalar documents

  • cc9fe145 fix go syntax issue when field has 2 directives

  • 6b70be03 v0.9.2 postrelease bump

v0.9.2 - 2019-08-08

5628169d Merge pull request #822 from 99designs/windows-import-path-loop

fix for windows infinite loop

12893fa4 Merge pull request #821 from 99designs/fix-init

Fix config loading during gqlgen init

  • 5fafe79c Fix config loading during gqlgen init
2599f560 Merge pull request #820 from 99designs/keepalive-on-init

send keepalive on init

8f0d9b48 Merge pull request #816 from nii236/patch-1

Update cors.md to allow CORS for websockets

410d8322 Merge pull request #805 from andrey1s/golangci

enable-all linters on golangci-lint

da1c208e Merge pull request #795 from oshalygin/feature/issue-794-resolve-dead-readme-link

Update GraphQL Reference Link

8343c32c Merge pull request #784 from y15e/add-missing-header

Add a missing "Upload" header

8302463f Merge pull request #797 from muesli/format-fixes

Format import order using goimports

f2825e09 Merge pull request #801 from Schparky/patch-1

Documentation: getting-started edits

3db5627f Merge pull request #807 from flrossetto/patch-1

Fix doc

  • ab228f1b Update cors.md to allow CORS for websockets
c4ac9347 Fix doc

map[string]{interface} -> map[string]interface{}

419f966d Update GraphQL Reference Link (closes #794)
  • The link in the readme has been updated to reference a post by Iván Corrales Solera, "Dive into GraphQL". The previous link does not resolve, likely because the personal site is no longer hosted.
373359de Merge pull request #781 from 99designs/fix-default-directives-init

Set default directives after parsing config

  • ca8b21e3 Add a missing header

  • 8cab5fba Set default directives after parsing config

d2c5bf2a Merge pull request #780 from zdebra/master

fixed generating a description to golang comments for enum type

bf2cc90e Merge pull request #768 from 99designs/fix-ptr-from-directive

Fix pointer returns from directive

  • 446c3df3 fixed generating a description to golang comments for enum type

  • 414a4d34 Merge pull request #771 from sunfmin/master

  • 4d1484b0 Fix doc for how to use @goField directives forceResolver option

  • 6f3d7310 Fix pointer returns from directive

  • 21b65112 v0.9.1 postrelease bump

v0.9.1 - 2019-06-27

1bbc0cd6 Update release process to keep tags on master

this was affecting the version shown in go modules when using commits

5ffc2975 Merge pull request #764 from 99designs/fix-field-directives-on-roots

fix field schema directives applied to roots

  • ef3830b5 fix field schema directives applied to roots
17ee40ba Merge pull request #761 from 99designs/autobinding

Autobind models

fc3755f1 Merge pull request #732 from 99designs/schemaconfig-plugin

Add a plugin for configuring gqlgen via directives

  • c14f8650 Add docs

  • 64aca616 Merge remote-tracking branch 'origin/master' into schemaconfig-plugin

5e7e94c8 Merge pull request #756 from andrey1s/field

generate field defenition and execute field directive

ad2ca304 Merge pull request #759 from 99designs/circle-workflows

CircleCI workflows

2dc8423b Merge pull request #758 from franxois/patch-1

Update dataloaders.md

d0db28ab Update dataloaders.md

Make SQL request use requested IDs

  • a58ecfe9 add example and test field directive

  • 526beecb update generate field

  • 6e9d7dab generate types directive by location

  • dfec7b68 define fieldDefinition template

  • be890ab9 use UnmarshalFunc in args directives implement

  • dd162f04 define implDirectives template

56f3f92b Merge pull request #755 from 99designs/fix-globbing-windows

fix globbing on windows

ba176e2e Merge pull request #754 from 99designs/coveralls

Add coveralls

f4a69ab5 Merge pull request #744 from andrey1s/directive

add Execute QUERY/MUTATION/SUBSCRIPTION Directives

7fed71b6 Merge pull request #728 from fgallina/make-generated-resolver-dependent-types-follow-configured-type

resolvergen: use the resolver type as base name for dependent types

cb284c56 Merge pull request #734 from DBL-Lee/master

Automatic Persisted Queries

726a94f4 Merge pull request #750 from 99designs/ws-connection-param-check

[websocket] Add a config to reject initial connection

  • 69d7e282 move directive to directives.gotpl
090f0bd9 Merge pull request #722 from marwan-at-work/deps

resolve all pkg dependencies

  • c397be0c Update websocketInitFunc to return error instead of boolean

  • be18ae1f Add a test

  • a6508b6d Update typing, function name and small code refactor

  • e6d791a9 Add websocketOnConnectFunc as a config that can be used to validate websocket init requests

c5acbead resolvergen: use the resolver type as base name for dependent types

The template was outputing invalid code since the resolver type was not used in places like the embedding at {query,mutation}Resolver.

This change also ensures that objects like {query,mutation}Resolver also use the user provided type name as suffix.

Here's the resulting diff on the code generation with type: GeneratedResolver in the resolver config:

diff -u resolver.go resolvernew.go
--- resolver.go 2019-05-26 20:04:15.361969755 -0300
+++ resolvernew.go      2019-05-26 20:04:54.170737786 -0300
@@ -7,20 +7,20 @@
 type GeneratedResolver struct{}

 func (r *GeneratedResolver) Mutation() MutationResolver {
-       return &mutationResolver{r}
+       return &mutationGeneratedResolver{r}
 }
 func (r *GeneratedResolver) Query() QueryResolver {
-       return &queryResolver{r}
+       return &queryGeneratedResolver{r}
 }

-type mutationResolver struct{ *Resolver }
+type mutationGeneratedResolver struct{ *GeneratedResolver }

-func (r *mutationResolver) CreateTodo(ctx context.Context, input NewTodo) (*Todo, error) {
+func (r *mutationGeneratedResolver) CreateTodo(ctx context.Context, input NewTodo) (*Todo, error) {
        panic("not implemented")
 }

-type queryResolver struct{ *Resolver }
+type queryGeneratedResolver struct{ *GeneratedResolver }

-func (r *queryResolver) Todos(ctx context.Context) ([]*Todo, error) {
+func (r *queryGeneratedResolver) Todos(ctx context.Context) ([]*Todo, error) {
        panic("not implemented")
 }
  • cfdbc39a update QueryDirectives

  • f32571ee add SUBSCRIPTION Directive

  • 32462d0f update example todo add directive with location QUERY and MUTATION

  • 3eec887a add Execute QUERY/MUTATION/SUBSCRIPTION Directives

  • 8fcc1868 format

e0e1e318 Merge pull request #1 from radev/master

Support for external APQ cache

  • 9873d998 Add APQ documentation with example

  • 48292c10 Support pluggable APQ cache implementations.

  • 694f90aa Merge pull request #717 from cbelsole/schema_file_globbing (closes #631)

  • 9be5aad0 Don't inject builtins during schema config

  • 8dc17b47 support GET for apq

  • d36932c5 support automatic persisted query

  • de75743c Add plugin for providing config via schema directives

  • 17a82c37 Provide config to skip generating runtime for a directive

ba7092c5 Merge pull request #724 from saint1991/patch-1

added a missing close bracket

4f163cbc Merge pull request #713 from 99designs/faq

Add faq section

v0.9.0 - 2019-05-15

f3c8406d Merge pull request #710 from 99designs/slice-pointers

Use pointers to structs inside slices

  • e669d476 fix imports for vendor based projects

  • 315141d9 Use pointers to structs inside slices

9a6a10ab Merge pull request #706 from 99designs/mapping-primitive

Fix mapping object types onto go primitives

  • a5120054 fix binding to primitive non leaf types

  • b0cd95a1 Test mapping object types onto go string

eaa61bb5 Merge pull request #707 from 99designs/gomodules-performance

make gqlgen generate 10x faster in some projects

ab961ce0 Merge pull request #705 from 99designs/fix-error-race

Fix a data race when handling concurrent resolver errors

  • 71cc8554 make gqlgen generate 10x faster in projects with cgo

  • cab4babe Test mapping object types onto go primitives

  • 962470de Fix a data race when handling concurrent resolver errors

9ca43ba9 Merge pull request #701 from 99designs/modelgen-pointers

Use pointers when embedding structs in generated structs

  • 4f5e9cf0 always use pointers when refering to structs in generated models
e2ac8480 Merge pull request #704 from tul/doc-typo

Fix typo

0bd90809 Merge pull request #700 from 99designs/fix-interface-caseing

Fix interface casing

5586ee2c Merge pull request #702 from 99designs/drop-automatic-zeroisnull

Drop automatic conversion of IsZero to null

e49d44f7 Merge pull request #689 from tgwizard/enforce-request-content-type

Enforce content type for POST requests

  • 78f277e9 run go generate

  • d4b3de3a Merge remote-tracking branch 'origin/master' into enforce-request-content-type

f8ef6d2e Merge pull request #668 from mbranch/complexity

Fix: complexity case selection

c4805049 Merge pull request #655 from hantonelli/file-upload

File upload

4e359aa2 Merge pull request #686 from qhenkart/master

Adds default custom scalar of interface{}

  • aeccbce0 Update test include an example that uses io.Read interface directly

  • d9dca642 Improve documentation

  • f30f1c31 Fix fmt

  • 54226cdb Add bytesReader to reuse read byte array

02e9dd8e Fix complexity case selection

Use the GraphQL field name rather than the Go field name in the generated Complexity func.

Before this patch, overloading complexity funcs was ineffective because they were never executed.

It also ensures that overlapping fields are now generated; mapping all possible field names to the associated complexity func.

  • bf2d07a4 moves naming convention to a non-go standard
d1e8acda Merge pull request #687 from stereosteve/fix-includeDeprecated

Fix: omit deprecated fields when includeDeprecated=false

  • f7d0b9c8 Enforce content type for POST requests

  • 7d0b8eec Fix: omit deprecated fields when includeDeprecated=false

  • 89c87345 fix grammar in docs

  • 85643f5d fix import

  • ca96a155 update docs

  • 1de25d0c adds interface scalar type

  • 43fc53f9 Improve variable name

  • b961d34e Remove wrapper that is now not required

  • bb023476 Lint code

  • f8484159 Modify graphql.Upload to use io.ReadCloser. Change the way upload files are managed.

0306783e Revert "Change graphql.Upload File field to FileData."

This reverts commit 7ade7c2

afe33f73 Merge pull request #680 from asp24/collect-fields-performance

Better CollectFields performance

  • 7ba1b3b2 graphql.CollectFields now accept *RequestContext as first arg It was done because RequestContext is a part of executionContext and can be passed directly without extraction from ctx. This is increasing performance when model depth is high

  • 5dfa2285 Pre-allocate mem for collectFields() method result slice

  • 88cdbdf1 Rename getOrCreateField to getOrCreateAndAppendField to describe behaviour

  • a74abc47 Early return in shouldIncludeNode if directives empty

  • 7ade7c21 Change graphql.Upload File field to FileData.

  • da52e810 Extend test and don't close form file.

1c95d42a Merge pull request #678 from jonatasbaldin/gin-context-recipe

Fix unset key and comment block at Gin recipe docs

  • 0b39c445 Fix unset key and comment block
5aa6a20b Merge pull request #673 from marwan-at-work/tpl

codegen/templates: allow templates to be passed in options instead of…

8cae895b Merge pull request #676 from jonatasbaldin/gin-context-recipe

Add recipe to use gin.Context

  • 40c7b952 update test name

  • 5418a290 Add recipe to use gin.Context

  • 16f392ee add unit test

  • a0ee7172 codegen/templates: allow templates to be passed in options instead of os files

  • 2cf7f452 Fix comments (add request size limit, remove useless comments, improve decoding and function signature, improve documentation)

5ff60925 Merge pull request #665 from ezeql/patch-1

update README.md

b42e1ba6 update README.md

fix link

  • d3770395 Fix tests.

  • 2c1f8573 Fix lint errors.

  • 73b3a536 Fmt graphql.go

  • 83cde4b6 Fix tests. Improve code format.

  • 425849a6 Improve fileupload example readme. Update scalars.md. Add file-upload.md

  • 849d4b1e Make uploadMaxMemory configurable

  • fc318364 Improve format, inline const.

  • 662dc337 Move Upload to injected if defined in the schema as scalars

  • f244442e Fix merge. Remove regexp check.

bf79bc92 Merge branch 'master' into next

Conflicts:

codegen/config/config.go

handler/graphql.go

handler/graphql_test.go

v0.8.3 - 2019-04-03

3623f7fc Merge pull request #650 from andcan/plugin-funcmap

Allow plugins to provide additional template funcs

a2e59362 Merge pull request #652 from andrey1s/extraBuiltins

add extra builtins types when no type exists

c93d92ba Merge pull request #654 from sharkyze/fix-introscpetion-doc

doc: fix mistake on introspection doc page

  • 93e72b58 doc: fix error on introspection doc page
ef2e51ba Merge pull request #637 from 99designs/fix-is-slice

Fix Mapping Custom Scalar to Slice

  • e5ff6bc2 add extra builtins types when no type exists

  • 8225f63a Allow plugins to provide additional template funcs

  • 7b533df1 Update ISSUE_TEMPLATE.md

  • 055157f9 Update ISSUE_TEMPLATE.md

a148229c Merge pull request #644 from Sauraus/master

Fix Gin installation instruction

52624e53 Fix Gin installation instruction

Current go get gin instruction results in an error from Go: package gin: unrecognized import path "gin" (import path does not begin with hostname)

  • 515f2254 Add test case for custom scalar to slice
2284a3eb Improve IsSlice logic to check GQL def

Currently TypeReference.IsSlice only looks at the Go type to decide. This should also take into account the GraphQL type as well, to cover cases such as a scalar mapping to []byte

v0.8.2 - 2019-03-18

8ac8a1f8 Merge pull request #635 from 99designs/fix-inject-builtin-scalars

Only Inject Builtin Scalars if Defined in Schema

  • d10e048e Add docs for built-in scalar implementations

  • d27e6eb6 Add example case for object type overriding builtin scalar

  • d567d5c8 Inject non-spec builtin values only if defined

3e39b57a Merge pull request #634 from 99designs/fallback-to-string

Use graphql.String for types wrapping a basic string

  • a2cce0d1 Use graphql.String for types wrapping a basic string
fc05501b Merge pull request #633 from 99designs/fix-union-pointers

Fix Having Pointers to Union Types

  • f02dabb7 Add test case for union pointer
8257d423 Check Go type rather than GQL type for ptr

This is probably a more correct way to check whether we should wrap the type in a pointer or not, rather than looking at the GrapQL definition. There may be use-cases where a GraphQL interface/union might be mapped to a Go stuct.

5df0938f Merge pull request #628 from 99designs/fix-ambient-imports

Move ambient imports into cmd package

8e1590d7 Move ambient imports into cmd package

The getting started docs for dep suggest creating a local gqlgen script, however these ambient import are in the root, so dep misses them.

This was changed in 0.8 but the ambient imports weren't moved.

58744de9 Merge pull request #622 from 99designs/handle-complexity-root-collisions

Handle colliding fields in complexity root gracefully

  • c889b314 Handle colliding fields in complexity root gracefully
26c395b0 Merge pull request #620 from codyleyhan/cl/error

Allow user to supply path to gqlerror

  • 12cf01aa Allow user to supply path to gqlerror
932322b6 Merge pull request #619 from 99designs/nil-slices

Support returning nulls from slices

  • a48c55b2 Support returning nulls from slices
2b270e4d Merge pull request #618 from codyleyhan/cl/method

Adds way to determine if a resolver is a function call or value

ac2422e3 Merge pull request #614 from wesovilabs/master

Adding entry for workshop

db4f7255 Merge pull request #613 from icco/patch-2

Upgrade graphql-playground to 1.7.20

163bfc76 Merge pull request #612 from 99designs/maps-changesets

Maps as changesets

08f936e1 Upgrade graphql-playground to 1.7.20

CSS didn't change but js did.

8fb1fafd Merge pull request #611 from 99designs/gqlparser-1.1.2

Bump gqlparser to 1.1.2

  • 37983a5f remove some invalid test schema

  • 765ff738 Add some docs on maps

  • 0a92ca46 Support map[string]interface{} in return types

ac56112b Merge pull request #610 from tgwizard/dynamic-complexity

Allow configuring the complexity limit dynamically per request

  • a89050aa Bump gqlparser to 1.1.2

  • dd288145 Allow configuring the complexity limit dynamically per request

485ddf30 Merge pull request #605 from 99designs/fix-default-scalars

Fix default scalars

3ca2599a Merge pull request #606 from jonatasbaldin/add-gin-recipe

Add Gin recipe

22be59d1 Merge pull request #604 from cevou/arg-scalar

Fix directives on args with custom type

  • d02736dc Added test for fix directives on args with custom type

  • 30d235bc Fix default scalars

d7b5dc28 Merge pull request #591 from 99designs/fix-577

Fix mixed case name handling in ToGo, ToGoPrivate

  • bef6c0a9 Fix directives on args with custom type

  • bc386d79 Fix mixed case name handling in ToGo, ToGoPrivate

v0.8.1 - 2019-03-07

d872af63 Merge pull request #582 from demdxx/master

Load the playground sources from HTTPS by default

8e66832f Merge pull request #589 from 99designs/fix-autocasing-modelgen-bugs

Fix autocasing modelgen bugs

8e00703e Merge pull request #588 from 99designs/fix-default-scalar-implementation-regression

Fix default scalar implementation regression

  • b27139ed Fix default scalar implementation regression
737a59a3 Merge pull request #579 from 99designs/fix-camelcase

Take care about commonInitialisms in ToGo

5ba8c8ea Add builtin flag for build directives

These have an internal implementation and should be excluded from the DirectiveRoot. In the future this may be a func that plugins could use to add custom implementations.

b8526698 Load the playground sources from HTTPS by default

For some browsers on non-secure domains resources from CDN doesn't loads, so I made all cdn.jsdelivr.net resources of the playground by HTTPS by default

  • 6ea48ff6 Take care about commonInitialisms in ToCamel
1968a7bc Merge pull request #576 from jflam/patch-1

Update README.md

44becbbe Update README.md

Fixed typo in MD link ttps -> https

v0.8.0 - 2019-03-04

55df9b8d Merge pull request #574 from 99designs/next

v0.8.0

aedcc68a Merge pull request #573 from 99designs/plugin-docs

Very rough first pass at plugin docs

  • 8f91cf56 Very rough first pass at plugin docs
3d9ad75e Merge pull request #572 from 99designs/handle-nonexistant-directories-when-genreating-packagenames

Handle non-existant directories when generating default package names

  • 08923334 Handle non-existant directories when generating default package names
2ef4b443 Merge pull request #571 from 99designs/automatically-bind-to-int32-int64

Automatically bind to int32 and int64

2888e96c Merge pull request #570 from 99designs/vendor-packages-workaround

Workaround for using packages with vendored code

  • fb87dc39 Automatically bind to int32 and int64
f2d9c3f7 Merge pull request #569 from 99designs/improve-introduction

Introduction Improvements

  • 1e7aab63 Workaround for using packages with vendored code

  • 5c692e29 User README as canonical introduction

  • 25bdf3d6 Consolidate Introduction documents

  • d81670d8 Add initial contributing guidelines

  • d9a9a532 playground: secure CDN resources with Subresource Integrity

cb38b4be Merge pull request #568 from MichaelMure/secured-playground

playground: secure CDN resources with Subresource Integrity

0258e1a2 Merge pull request #565 from steebchen/next

Fix cli config getters

  • 6ad1d97e Move feature comparison

  • 37cbbd6d playground: secure CDN resources with Subresource Integrity

  • da12fd11 Fix cli config getters

51266b8f Merge pull request #554 from 99designs/fix-missing-recover

Recover from panics in unlikly places

  • 67795c95 Recover from panics in unlikly places
56163b45 Merge pull request #553 from 99designs/getting-started-0.8

Update Getting Started for 0.8 and Go Modules

  • 0bd120b5 Update dep code as well

  • 6c576032 Update getting started with 0.8 generated code

  • ba761dcf Reintroduce main package in root

  • cdc575a2 Update getting started with Go Modules support

  • 378510e5 Move Getting Started above Configuration

  • d261b3fb Fix navigation font weights

327a1a34 Merge pull request #551 from 99designs/improved-collect-fields-api

Improved Collect Fields API and Documentation

6439f197 Merge pull request #552 from 99designs/always-return-struct-pointers

Always return *Thing from resolvers for structs

  • 318639bb Always return *Thing from resolvers for structs

  • e61b3e0b Add Field Collection docs

ef0223cf Merge pull request #541 from 99designs/fix-underscore-only-fields

Allow underscore only fields and naming collisions to be aliased explicitly

015d02eb Merge pull request #542 from Elgarni/add-more-validation-checks-on-yml-config-file

Add more validation checks on .yml config file

647c62a5 Merge pull request #550 from 99designs/fix-unstable-marshaler-func

Fix unstable external marshaler funcs with same name as type

  • 3a8bf33f Add CollectAllFields test cases

  • 9ebe7717 Fix unstable external marshaler funcs with same name as type

a1195843 Merge pull request #544 from enjoylife/fix-directive

Fix directives on fields with custom scalars

  • dc925c46 Added a test for config checking

  • b56cb659 Refactored config check so that it runs after being normalized

  • dc6a7a36 Add CollectAllFields helper method

a2e61b3d Added a model and used directive on an input field within the integration schema

Added to the integration schema such that the build will catch the directive bug in question.

  • 0b0e4a91 Fix directives on fields with custom scalars

  • 8ac0f6e4 Removed redundant semicolons

  • 3645cd3e Add more validation checks on .yml config file

1b8b1ea1 Fix typo in README

Fix typo in README in selection example directory to point to the selection example, not the todo example.

66120d8f Merge pull request #535 from awiede/master

Fix typo in README

  • fcacf200 Merge remote-tracking branch 'origin/master' into HEAD
b9819b21 Merge pull request #540 from 99designs/check-is-zero

Automatically convert IsZero to null

03a655dc Merge pull request #526 from 99designs/union-fragment-bug

Union Fragment Bug Fix

  • 99e9f41f Use Implements for type Implementors in codegen
ccca823f Separate out conditionals in collect fields

These conditions are not really related, and I missed the second conditional when reading through the first time.

  • efe8b026 Add reproducable test cases

  • 306da15f Automatically convert IsZero to null

  • f81c61d3 Merge pull request #539 from 99designs/test-nullable-interface-pointers (closes #484)

f5200c80 Merge pull request #498 from vilterp/playground-content-type

add content-type: text/html header to playground handler

48a7e07f Merge pull request #537 from 99designs/stub-generation

Stub generation

  • 787b38d8 Break testserver tests down into smaller files using stubs

  • c5e3dd44 add stub generation plugin

43db679a Merge pull request #534 from 99designs/multiple-bind-types

Multiple bind types

7d394222 Fix typo in README

Fix typo in README in selection example directory to point to the selection example, not the todo example.

82ded321 Merge pull request #532 from 99designs/fix-missing-json-content-type

Fix set header to JSON earlier in GraphQL response

Update the GraphQL handler to set the Response Header to JSON earlier for error messages to be returned as JSON and not text/html.

Fixes 99designs#519

Notes:

  • Add checks for JSON Content-Type checks in decode bad queries tests
b4c5a074 Fix set header to JSON earlier in GraphQL response

Update the GraphQL handler to set the Response Header to JSON earlier for error messages to be returned as JSON and not text/html.

Fixes 99designs#519

== Notes:

  • Add checks for JSON Content-Type checks in decode bad queries tests
a7c8abe6 Merge pull request #529 from 99designs/websocket-keepalive

Add websocket keepalive support

  • 555d7468 Remove TypeDefinition from interface building

  • cfa012de Enable websocket connection keepalive by default

c5b9b5a8 Use constant tick rate for websocket keepalive

Some clients (e.g. apollographql/subscriptions-transport-ws) expect a constant tick rate for the keepalive, not just a keepalive after x duration of inactivity.

d0b6485b Merge pull request #525 from 99designs/stop-grc-panic

Stop GetResolverContext from panicking when missing

78cfff48 Merge pull request #528 from 99designs/fix-todo-directive

Fix Todo Example Directive

5e1bcfaf Remove parent check in directive

This should always be true, and currently has a bug when comparing pointers to structs. Can just be removed.

  • c1b50cec Stop GetResolverContext from panicking when missing

  • 44aabbd3 Move all build steps back into file containing defs

  • 4e49d489 Merge object build and bind

  • 97764aec move generated gotpl to top

  • d380eccf promote args partial to full template

  • 1bc51010 Everything is a plugin

055fb4bc Merge pull request #514 from 99designs/gomod

Add support for go modules

62175eab Merge pull request #502 from 99designs/model-plugin

Model plugin

d3f1195c add `content-type: text/html` header to playground handler

This ensures that the browser doesn't think it should download the page instead of rendering it, if the handler goes through a gzipping middleware.

f94b4b78 Merge pull request #497 from azavorotnii/small_fixes

Small fixes

  • 21769d93 Ensure no side affect from preceding tests in wont_leak_goroutines test

  • 10f4ccde newRequestContext: remove redundant else part

  • a76e0228 Add cache usage for websocket connection

  • 940db1f9 Fix cacheSize usage in handler

fba9a378 Merge pull request #492 from 99designs/unified-merge-pass

Unified merge pass

  • a7f719a3 update appveyour to not rely on main

  • f46b7c8e Reclaim main package for public interface to code generator

  • 6b829037 Extract builder object

  • 87b37b0c Replace string based type comparisons with recursive types.Type check

82b1917d Merge pull request #490 from 99designs/bind-directly-to-types

Bind directly to AST types, instead of copying out random bits

  • 1d86f988 extract argument construction

  • 4b85d1b0 Merge buildInput into buildObject

  • db33d7b7 Extract graphql go merge into its own package

  • afc773b1 Use ast definition directly, instead of copying

  • 8298acb0 bind to types.Types in field / arg references too

  • 38add2c2 Remove definition embedding, use normal field instead

  • 950ff42c Bind to types.Type directly to remove TypeImplementation

  • 70c852eb Add lookup by go type to import collection

  • eb101161 Remove aliased types, to be replaced by allowing multiple backing types

e79252b0 Merge pull request #488 from 99designs/refactor-config

Refactor config

  • 4138a372 rename generator receiver

  • bec38c7e Extract config into its own package

  • 34b87871 Rename core types to have clearer meanings

  • f10fc649 Merge remote-tracking branch 'origin/next' into HEAD

dd972081 Merge pull request #486 from nicovogelaar/feature/list-of-enums

add list of enums

  • 1140dd85 add unit test for list of enums

  • 1e3e5e9b add list of enums

  • f87ea6e8 Merge remote-tracking branch 'origin/master' into HEAD

473f4f0c Merge pull request #465 from 99designs/performance-improvments

Performance improvments

5c8b1e24 Avoid unnessicary goroutines

goos: linux goarch: amd64 pkg: github.com/99designs/gqlgen/example/starwars BenchmarkSimpleQueryNoArgs-8 300000 25093 ns/op 6453 B/op 114 allocs/op PASS ok github.com/99designs/gqlgen/example/starwars 10.807s

b0ffa22a Remove strconv.Quote call in hot path to avoid some allocs

go test -benchtime=5s -bench=. -benchmem goos: linux goarch: amd64 pkg: github.com/99designs/gqlgen/example/starwars BenchmarkSimpleQueryNoArgs-8 200000 32125 ns/op 6277 B/op 118 allocs/op PASS ok github.com/99designs/gqlgen/example/starwars 9.768s

2cf5a5b8 Add a benchmark

go test -benchtime=5s -bench=. -benchmem goos: linux goarch: amd64 pkg: github.com/99designs/gqlgen/example/starwars BenchmarkSimpleQueryNoArgs-8 200000 32680 ns/op 6357 B/op 126 allocs/op PASS ok github.com/99designs/gqlgen/example/starwars 9.901s

  • 5e0456fe fix fmt anf metalint generated code

  • b32ebe14 check nullable value for go1.10

  • d586bb61 use arg value for the ResolveArgs

  • e201bcb5 set default nil arg to ResolverContext

  • 6fa63640 remove empty line in generated files

  • 139ed9fb fix go10 assign exist variable by eq

  • 428c6300 add nullable argument to directives

  • 74096033 move chainFieldMiddleware to generate code for BC

  • be51904c check nullable arguments

  • 6b005094 add test directives generate

  • 047f2ebc update inline template

  • a13b31e9 metalinter

  • 526bef0b generate servers and add path to error

  • 29770d64 resolve = in template

  • 3a729cc3 update recursive middleware

  • 8b3e634e update tempate and set Dump public

  • e268bb75 Merge remote-tracking branch 'upstream/master' into directives

  • e8f0578d add execute ARGUMENT_DEFINITION and INPUT_FIELD_DEFINITION directive

v0.7.2 - 2019-02-05

8c0562c1 Merge pull request #530 from 99designs/websocket-keepalive-master

Add websocket keepalive support

  • 43fdb7da Suppress staticcheck lint check on circleci
9c4b877a Use constant tick rate for websocket keepalive

Some clients (e.g. apollographql/subscriptions-transport-ws) expect a constant tick rate for the keepalive, not just a keepalive after x duration of inactivity.

  • d36d3dc5 Add websocket keepalive support
39216361 Merge pull request #476 from svanburen/patch-1

Update config.md

9f6f2bb8 Update config.md

Add a missed word and add an apostrophe

5c870a48 Merge pull request #461 from ryota548/patch-1

Update getting-started.md

9bcd27c1 Update getting-started.md

modify graph/graph.go to resolver.go

v0.7.1 - 2018-11-29

3a7f37c7 Merge pull request #455 from 99designs/fix-deprecated-fields

Fix deprecated fields

  • b365333b Fix graphiql deprecating all fields

  • 99610be9 Get chat example up to date

v0.7.0 - 2018-11-28

4bfc82d7 Merge pull request #453 from 99designs/deprecate-binary

Add Deprecation Warning to Binary

8dd29b85 Merge pull request #454 from 99designs/update-gqlparser

Update gqlparser to latest

d6d9885f Merge pull request #416 from 99designs/improved-getting-started

Improve Getting Started Documentation — No Binary Approach

  • d22f03c6 Add deprecation warning

  • 878f3945 Minor fixes to getting started code examples

6a02657c Merge pull request #447 from 99designs/disable-introspection

Add config option to disable introspection

  • b9fbb642 Mention recursive-ness of generate ./...

  • e236d8f3 Remove generate command from resolver.go

  • 04a72430 Re-add final touches section to getting started

  • 3a7a5062 Add handler import to root cmd

  • 9dba96d5 Fix GraphQL capitalisation

  • 1dfaf637 Minor updates to getting started from feedback

  • 94b95d97 Some CSS fixes

  • a36fffd2 Updated getting started with new no-binary approach

  • 601354b3 Add blockquote breakout style

6bea1d88 Merge remote-tracking branch 'origin/master' into disable-introspection

Regenerate

e4bad0e6 Merge pull request #449 from 99designs/increase-float-precision

Increase float precision

c5589792 Merge pull request #450 from 99designs/import-refactor

Refactor import handling

  • 62f0d085 Edit copy for introspection docs
63fc2753 Merge pull request #452 from cemremengu/patch-1

Fix typo in directives.md

da31e8ed Update directives.md

Fix small typo

9d636e78 Merge pull request #448 from 99designs/update-gqlparser

Update to latest gqlparser

  • d6ce42df Update to latest gqlparser

  • b0acd078 Add config option to disable introspection

f9c880b6 Merge pull request #446 from 99designs/fix-flakey-test

Fix flakey goroutine test

5461e967 Merge pull request #445 from 99designs/remove-graphqlgen

Remove graphqlgen link

4b082518 Merge pull request #439 from snormore/pointer-slice

Fix type binding validation for slices of pointers like []*foo

77b27884 Merge pull request #443 from mgutz/patch-1

fix generate stubs sentence

  • ae1c7732 fix generate stubs sentence

  • 827dac5e Fix type binding validation for slices of pointers like []*foo

f7932b40 Merge pull request #435 from matiasanaya/update-readme

Update README.md comparison with graph-gophers

  • a816208b Update README.md comparison with graph-gophers
d25e3b4b Merge pull request #422 from gracenoah/model-method-context

accept an optional ctx parameter on model methods

0ac6fa57 Merge pull request #434 from urakozz/patch-1

Tracer: fixed nil pointer issue

4c4ccf47 Update context.go

Right now code generated with latest master fails since there are usages of Trace but there is no any single write to this variable

02a19352 Merge pull request #429 from 99designs/refactor-gofmt

apply go fmt ./...

3f598bdc Merge pull request #427 from anurag/patch-1

Fix docs typo

9f4afe3a Merge pull request #425 from 99designs/render

Switch to hosting docs on render.com

9875e74b Switch to hosting docs on render.com

Render.com has offered to host our static site for free, and have a pretty simple setup for rebuilding on merge to master. I've switched the DNS records and updated the docs.

981fd10a Merge pull request #419 from 99designs/fix-capture-ctx

fix unexpected ctx variable capture on Tracing

4bda3bc1 Merge pull request #411 from 99designs/feat-geterrors

add GetErrors to RequestContext

  • a4eaa400 add tests for RequestContext#GetErrors
53f33f77 Merge pull request #410 from 99designs/move-tracing-to-contrib

Move tracing to contrib

a3a92775 Merge pull request #409 from 99designs/graphql-playground-1.7.8

Bump to the latest version of graphql-playground

d2648580 Merge pull request #402 from 99designs/feat-opencensus

add Tracer for OpenCensus

  • 7286e244 fix shadowing

  • af38cc5a Bump to the latest version of graphql-playground

  • 8bbb5eb7 fix some tests

  • 256e741f add complexityLimit and operationComplexity to StartOperationExecution

  • 4e7e6a1c Merge branch 'master' into feat-opencensus

926ad17a Merge pull request #403 from 99designs/feat-complexity

copy complexity to RequestContext

  • 2d3026cb Merge branch 'master' into feat-complexity

  • 59ef91ad merge master

  • c9368904 Merge branch 'master' into feat-opencensus

b26ee6b4 Merge pull request #404 from 99designs/feat-apollo-tracing

add apollo-tracing support

0d5c65b6 Merge pull request #400 from 99designs/fix-ci

fix Circle CI test

1b17b5a2 Merge pull request #392 from 99designs/feat-tracer

Add Tracer layer

184e48cb Merge pull request #396 from 99designs/remove-ci-exclusion

Run generate ./... and test ./... in circle

fd5d9eca Merge pull request #395 from 99designs/feat-extension-example

add Type System Extension syntax example

195f952b fix CI failed

AppVeyor handle this test, But Circle CI is not

  • b5b767c4 address comment

  • d723844b add Type System Extension syntax example

  • df685ef7 change timing of EndFieldExecution calling

  • 94b7ab02 refactor Tracer interface signature that fit to apollo-tracing specs

8eb2675a Revert "change field marshaler return process that make it easy to insert other processing"

This reverts commit 583f98047f5d1b6604d87e7b8d6f8fd38082d459.

  • c8af48cd rename Tracer method name

  • a3060e80 refactor Tracer signature

  • d319afe6 add support request level tracer

  • 1c5aedde add support field level tracer

  • 583f9804 change field marshaler return process that make it easy to insert other processing

  • ab4752c2 Update README.md

3447dd2d Merge pull request #389 from 99designs/multiple-schemas

Support multiple schemas

20a5b6c7 Merge pull request #369 from vetcher/master

reverse errors and data order in response

  • f1f043b9 reverse 'data' and 'error' fields order in failure tests
3eab22a3 Merge pull request #370 from rodrigo-brito/fix-underscore

Underscore on field name finder

  • 0ad3d3ce fix on struct name finder

  • 42e11045 reverse errors and data order in response

v0.6.0 - 2018-10-03

7833d0cb Merge pull request #365 from 99designs/dont-guess-imports

Don't let goimports guess import paths

  • 732be395 Don't let goimports guess import paths
926eb9d8 Merge pull request #364 from 99designs/query-cache-test

Add a stress test on query cache

  • bab70df5 Add a stress test on query cache
84481761 Merge pull request #362 from 99designs/fix-error-docs

fix error docs

8f0ef777 Merge pull request #361 from 99designs/revert-360-revert-335-typed-interfaces

Revert "Revert "Generate typed interfaces for gql interfaces & unions""

  • 77257d1e Revert "Revert "Generate typed interfaces for gql interfaces & unions""
1cae19bb Merge pull request #359 from 99designs/fix-null-arg-error

Fix Issue With Argument Pointer Type

ee862717 Merge pull request #360 from 99designs/revert-335-typed-interfaces

Revert "Generate typed interfaces for gql interfaces & unions"

  • 02658647 Revert "Generate typed interfaces for gql interfaces & unions"
bc35d730 Merge pull request #335 from 99designs/typed-interfaces

Generate typed interfaces for gql interfaces & unions

f5c03401 Do not strip ptr for args with defaults

This fails if a client still sends a null value. If an arg is nullable but has a default, then null is still a valid value to send through.

b836a976 Merge pull request #358 from 99designs/fix-embedded-pointer

Fix Embedded Pointer

  • d3e27553 Bump gqlparser to latest master

  • b8af0c81 Use types.Implements to check if an interface implementor accepts value recievers

2ab05daf Merge pull request #353 from 99designs/resolver-ctx-parenting

Parent middleware generated contexts

  • faf0416b Parent resolver generated contexts

  • caa474c6 Check for embedded pointer when finding field on struct

  • f302b408 Added reproduce test case

14cf46bc Merge pull request #348 from gissleh/feat-websocket-initpayload

Added parsing of the websocket init message payload

  • 3147d914 Updated example in docs to use handler.GetInitPayload instead of graphql.GetInitPayload

  • 32f0b843 Moved InitPayload from graphql to handler package, updated test to import it from there.

  • 01923de6 Moved initPayload to wsConnection member, changed wsConnection.init to return false on invalid payload

  • 25268ef9 Added information about it under recipes/authentication doc

  • 575f28e0 Fixed graphql.GetInitPayload panic if payload is nil.

380828fa Added parsing of the websocket init message payload, and making it available via the context passed to resolvers.
  • Added GetInitPayload(ctx) function to graphql
  • Added WithInitPayload(ctx) function to graphql
  • Added WebsocketWithPayload method to client.Client (Websocket calls it with a nil payload for backwards compability)
  • Added tests for these changes in codegen/testserver/generated_test
2bd1cc2e Merge pull request #334 from 99designs/support-response-extensions

Support Extensions in Response

  • 8fdf4fbb Add test case for extension response

  • 60196b87 Add extensions to response struct

  • cbde0ea9 Generate typed interfaces for gql interfaces & unions

v0.5.1 - 2018-09-13

869215a7 Merge pull request #339 from 99designs/fix-subscription-goroutine-leak

Fix gouroutine leak when using subscriptions

535dd24b Merge pull request #338 from codyleyhan/cl/docs

Adds docs for how resolvers are bound

647fbbc9 Merge pull request #340 from chris-ramon/patch-1

README.md: Updates graphql-go/graphql features.

729e09c8 README.md: Updates `graphql-go/graphql` features.
  • 229a81be Fix gouroutine leak when using subscriptions

  • c15a70ff Adds docs for how resolvers are bound

  • 35c15c94 Add link to talk by Christopher Biscardi

72edf98a Merge pull request #331 from edsrzf/arg-refactor

Refactor arg codegen

  • 31505ff4 Use arg function for generated Complexity method

  • ebdbeba0 Just realized "if not" is allow in templates

  • 861a805c Regenerate code

639727b6 Refactor arg codegen

Now a function is generated for each field and directive that has arguments. This function can be used by both field methods as well as the Complexity method.

The args.gotpl template now generates the code for this function, so its purpose is a little different than it used to be.

8026e63b Merge pull request #330 from edsrzf/string-compare

Use built-in less than operator instead of strings.Compare

  • c770b4e7 Use built-in less than operator instead of strings.Compare

v0.5.0 - 2018-08-31

b48c6b92 Merge pull request #326 from 99designs/version

Add version const

7d44dd6b Merge pull request #315 from edsrzf/query-complexity

Query complexity calculation and limits

  • 2ab857ee Merge branch 'master' into query-complexity

  • 6e408d5d Interfaces take max complexity of implementors

d08b9c4a Merge pull request #325 from edsrzf/no-get-mutations

Only allow query operations on GET requests

82a28b57 Only allow query operations on GET requests (closes #317)

This mitigates the risk of CSRF attacks.

  • 239b1d22 Don't emit complexity fields for reserved objects

  • 8da5d61b Generate complexity for all fields. Fix bugs. Re-generate examples.

40943c6d Merge pull request #322 from 99designs/drop-old-flags

Drop old cli flags

8c17eea9 Merge pull request #320 from andrioid/master

Description added to generated Model code

988b367a Merge pull request #316 from 99designs/feat-concurrent-each-element

use goroutine about processing each array elements

f6a733ae Merge pull request #308 from codyleyhan/tags

Finds fields by configurable struct tag

f7aeb88a Merge pull request #321 from 99designs/remove-typemap

Remove support for the old json typemap

  • d63449b9 Remove support for the old json typemap

  • fce4c722 address comment

  • 8c3aed7d Merge branch 'master' into query-complexity

cecd84c6 Add complexity package tests

Also some small behavior fixes to complexity calculations.

002ea476 Merge pull request #318 from edsrzf/query-cache

Add query cache

  • fcd700b6 Panic on lru cache creation error
78c57079 Add query cache

This commit adds a query cache with a configurable maximum size. Past this size, queries are evicted from the cache on an LRU basis.

The default cache size is 1000, chosen fairly arbitrarily. If the size is configured with a non-positive value, then the cache is disabled.

Also ran dep ensure to add the new dependency to Gopkg.lock.

  • 076f9eac removed dirt

  • 6ae82383 trying to get description with generated models

  • 7d6f8ed4 fixes case where embeded structs would cause no field to be found

  • 02873495 use goroutine about processing each array elements

  • 40f904a6 Merge branch 'master' of github.com:99designs/gqlgen into tags

  • 56768d6b adds tests for findField

  • 556b93ac Run go generate ./...

2dcb2dd8 Merge pull request #314 from 99designs/directive-obj

Add obj to Directives

  • 0e2aaa9e Merge branch 'master' of github.com:99designs/gqlgen into tags

  • 7cfd9772 fixes field selection priority

  • 238a7e2f Add complexity support to codegen, handler

  • 95ed529b New complexity package

  • 1fda3ede Add obj to Directives

9b247102 Merge pull request #301 from 99designs/feat-directive-parent

add Result field to ResolverContext

  • 9ec385d1 Merge branch 'tags' of github.com:codyleyhan/gqlgen into tags

  • c5849929 adds binding by passed tag

  • 6ef2035b refactor set Result timing

  • 568a72e9 add some refactor

50588a8a Merge pull request #299 from 99designs/test-init-on-windows

Test gqlgen init on windows

  • 9148adfc Test gqlgen init on windows

  • c7fd8416 Merge branch 'master' into feat-directive-parent

3f8a601b Merge pull request #312 from 99designs/validate-gopath

Validate gopath when running gqlgen

77e69552 Merge pull request #310 from 99designs/sitemap-404s

Remove 404s from sitemap

0b6cedfb Merge pull request #311 from jekaspekas/fix-mapstructure-err

fix mapstructure unit test error

  • b07736ef Validate gopath when running gqlgen
b082227d fix mapstructure unit test error

fix unit test error "mapstructure: result must be a pointer". It appears instead of resolver returned error.

4a6f505d Merge pull request #309 from 99designs/pr-template

Add a PR template

  • 64f3518e run generate

  • a81147df Add a PR template

  • 15d8d4ad Merge branch 'introspection-directive-args' into HEAD

  • 12efa2d5 add tests

  • 95b6f323 finds fields by json struct tag

  • 07ee49f3 Added args to introspection scheme directives.

  • e57464fe refactor ResolverContext#indicies and suppress lint error

  • 09e4bf8c add Result field instead of ParentObject field

b8695fb5 Merge pull request #304 from 99designs/newline-for-init-response

Put newline at end of gqlgen init output

  • fabc6f8f Merge branch 'master' into feat-directive-parent

  • e53d224e Merge branch 'master' into feat-directive-parent

de750645 Merge pull request #298 from 99designs/handle-response-nulls

Nulls in required fields should cause errors and bubble

  • c8552729 Put newline at end of gqlgen init output

  • 072363c7 add ParentObject field to ResolverContext

e15d7890 Merge pull request #300 from 99designs/fix-starwars-connection-example

fix connection example

  • d6acec16 fix connection example

  • 7d1cdaca Nulls in required fields should cause errors and bubble

2c4e6cbf Merge pull request #294 from 99designs/simplfy-concurrent-resolvers

Simplfy concurrent resolver logic

  • 7926c688 Simplfy concurrent resolver logic

v0.4.4 - 2018-08-21

  • 6f6622c6 Bump gqlparser to latest version
72659af4 Merge pull request #297 from 99designs/fix-dep-pruning

Explicitly import ambient imports so dep doesn't prune them

  • cac3c729 Explicitly import ambient imports so dep doesn't prune them
e6af26e0 Merge pull request #296 from heww/master

sort directives by name when gen

  • fd09cd99 sort directives by name when gen
71917267 Merge pull request #292 from m4ppi/fix-doc

Fix broken links in docs

5a0b56aa Merge pull request #285 from 99designs/fix-force-type

Stop force resolver from picking up types from matching fields

  • 31478cf4 Stop force resolver from picking up types from matching fields
ebdcf740 Merge pull request #283 from 99designs/speed-up-tests

Speed up tests

0.4.3 - 2018-08-10

3575c289 Merge pull request #281 from 99designs/introspection-default-args

Fix missing default args on types

  • b808253f Fix missing default args on types
bf235296 Merge pull request #282 from 99designs/flakey-tests

Remove sleeps in tests

0.4.2 - 2018-08-10

5c379a33 Merge pull request #279 from 99designs/integration-tests

Integration tests

53109cd0 Merge pull request #270 from 99designs/feat-handlers

stop pickup "github.com/vektah/gqlgen/handler" from GOPATH

  • ae82b94a convert existing tests to jest

  • f04820b1 address comment

  • 88730e2c Convert test directory into integration test server

  • f372b1c9 Use docker in docker for the existing testsuite

0eb08ab9 Merge pull request #274 from 99designs/fix-variable-validation-data

Prevent executing queries on variable validation failures

  • 47a7ac35 Prevent executing queries on variable validation failures

  • e6e323d0 stop pickup "github.com/vektah/gqlgen/handler" from GOPATH

  • e6005f6b fix mobile nav

5cdbc975 Merge pull request #267 from 99designs/authentication-docs

Authentication docs

  • 1871c4ce Add bold variant of Roboto to docs

  • fc9fba09 Some minor edits to authentication docs

  • d151ec8d Add docs on user authentication

  • 8db3c143 Add structure to menu

c57619e0 Merge pull request #260 from 99designs/init-improvements

Init Config Improvement

336b62ec Merge pull request #266 from 99designs/lint-friendly-decollision

Make keyword decollision more lint friendly

  • 2acbc245 Make keyword decollision more lint friendly
f12f08a7 Merge pull request #264 from 99designs/docs

CORS docs

0ab1c685 Merge pull request #263 from 99designs/add-logo

Add logo to doc site

  • 6d39f868 Add logo to doc site

  • d7241728 Better error on init if file exists

  • fb03bad9 Run init even if config is found

  • 52b78793 Fix hard-coded server filename in init

0.4.1 - 2018-08-04

42f10ec9 Merge pull request #255 from 99designs/introspection-fixes

Fix introspection api

b35804ba Merge pull request #254 from oskanberg/patch-1

Fix typo in introduction docs

0.4.0 - 2018-08-03

7b5a3d74 Merge pull request #247 from 99designs/next

0.4.0 Release

c0be9c99 Merge pull request #251 from 99designs/rewrite-imports

Rewrite import paths

f042328a Merge pull request #252 from 99designs/move-doc-site

Move doc site

07b7e6ca Merge pull request #248 from 99designs/json-usenumber

use json.Decoder.UseNumber() when unmarshalling vars

  • 95fe07fe use json.Decoder.UseNumber() when unmarshalling vars
c555f54c Merge pull request #245 from vektah/new-feature-docs

New feature docs

825840aa Merge pull request #244 from vektah/array-coercion

Add implicit value to array coercion

90b40769 Merge pull request #246 from vektah/fix-introspection

Fix introspection

  • ef208c76 add docs for resolver generation

  • e44d798d Add directives docs

  • 62d4c8aa Ignore __ fields in instrospection

  • bc204c64 Update getting started guide

  • b38c580a Return the correct mutation & subscription type

  • 9397920c Add field name config docs

  • d2265f3d Add implicit value to array coercion

191c8ba0 Merge pull request #239 from vektah/directive-args

Directive args

f78a6046 Merge pull request #241 from vektah/feat-lintfree

Make more golint free generated code

  • 19b58175 Merge remote-tracking branch 'origin/master' into HEAD

  • c3fa1a55 Merge branch 'next' into feat-lintfree

17bfa2cb Merge pull request #240 from vektah/doc-fonts

Use fonts from golang styleguide

  • 64ef0571 Use fonts from golang styleguide
6b532383 Merge pull request #237 from vektah/feat-fieldmapping

Add model field mapping

  • 4fb721ae address comment

  • bf43ab3d Merge branch 'next' into feat-fieldmapping

  • 353319ca Refactor GoVarName and GoMethodName to GoFieldName etc...

  • d7e24664 Add method support

17bcb322 Merge pull request #236 from vektah/generate-handler-on-init

Generate server on running init

600f4675 Merge pull request #238 from vektah/variable-validation

Add missing variable validation

ffee020c Merge pull request #235 from vektah/generate-resolver-on-init

Generate resolver on init

7031264d Merge pull request #229 from vektah/fix-init-command

Fixing init command

078bc985 Fixing init command

The init command always return file already exists if there are no configFilename specified

This is caused by codegen.LoadDefaultConfig() hiding the loading details and always return the default config with no error while the init command code expects it to tell us if config exists in default locations.

To avoid confusion I have splitted the loading config from default locations out into its own method so we can handle different cases better.

Additionally I also moved default config into a method so we always generating new a config instead of passing it around and potentially mutating the default config.

803711e9 Merge pull request #221 from vektah/middleware-stack

Implement FieldMiddleware Stack

0e16f1fc Generate FieldMiddleware

Moves it off of RequestContext and into generated land. This change has a basic implementation of how directive middlewares might work.

  • 2748a19b Require Config object into NewExecutableSchema

  • 09242061 Add Directives to Build

69e790c2 Add *Field to CollectedField

We need the Field Definition so that we can run directive middlewares for this field.

764c6fda Refactor ResolverMiddleware to FieldMiddleware

This will allow us to include DirectiveMiddleware in the same middleware setup, that will run after Resolver middlewares.

7226e573 Merge pull request #225 from rongfengliang/patch-1

Update getting-started.md

  • 66593ffe Merge remote-tracking branch 'origin/master' into HEAD

  • 8714f7fb hush metalinter

0dfb92a7 Update getting-started.md

CreateTodo UserID input should be UserId not User

0fa7977f Merge pull request #217 from vektah/resolver-middleware-all

Run Resolver Middleware For All Fields

7292be78 Rename CastType to AliasedType

This field stores a Ref if a type is a builtin that has been aliased. In most cases if this is set, we want to use this as the type signature instead of the named type resolved from the schema.

97f13184 Remove comment about ResolverMiddleware

Not true anymore!

  • b512176c Run resolver middleware for all fields
f67f8390 Merge pull request #218 from vektah/remove-old-resolvers

Remove old resolvers

1a3e4e99 Merge pull request #220 from vektah/feat-race

turn back -race option

1ba61fcb Update test & examples to use new resolver pattern
  • chat
  • dataloader
  • scalar
  • selection
  • starwars
  • todo
38708961 Stop generating two types of resolvers

In recent refactor we introduced a new pattern of resolvers which is better structured and more readable. To keep Gqlgen backward compatible we started generate two styles of resolvers side by side.

It is now time to sunset the old resolver. This commit removes the old resolver and update the generation code to use the new resolver directly.

  • ffe42658 Merge pull request #208 from vektah/directives-skip-include
a69071e3 Pass context to CollectFields instead of RequestContext

Internally it can still get to RequestContext as required.

  • d02d17ae Add method for generating method name from field

  • c7ff3208 Update gqlparser version to include default resolution

  • ce17cd90 Add default value test case

cbfae3d3 Add skip/include test cases

Adds a set of test cases for skip and include directives to the todo example. Also now conforms to spec if both are included.

ea0f821c Add skip/include directive implementation

This is a snowflake implementation for skip/include directives based on the graphql-js implementation. Skip takes precedence here.

  • ebfde103 Pass request context through to CollectFields
bab7abb2 Merge pull request #210 from vektah/feat-init

introduce gen & init subcommand

6ba508f9 Merge pull request #214 from vektah/gqlparser-schema-validation

Bump gqlparser to get schema validation

90df37f6 Merge pull request #205 from vektah/forward-credential-to-graphql-endpoint

Use original credential for query request in playground

52343745 Merge pull request #206 from vektah/validation-locations

Update gqlparser for validation locations

  • f4d31aa4 Update gqlparser for validation locations
9d473f8b Merge pull request #203 from vektah/99designs-announcement

Announcement: 99designs is now sponsoring gqlgen

c2f1570d Merge pull request #204 from vektah/gqlparser-prelude

Use shared prelude

edb3ea4e Use original credential for query request in playg

Currently the playground doesn't forward any credentials when making query calls. This can cause problems if your playground requires credential logins.

f855a89c Merge pull request #201 from cocorambo/remove-trailing-println

Remove trailing Println

2692d3e0 Merge pull request #197 from vektah/new-parser

Integrate gqlparser

01a4c677 Merge pull request #195 from jonstaryuk/master

Update playground version

  • c52f24af Update playground version to 1.6.2

0.3.0 - 2018-07-14

381b3469 Merge pull request #194 from vektah/multiline-comments

Fix multiline comments

eb44925c Merge pull request #193 from vektah/validate-method-returns

validate method return types

f478f816 Merge pull request #192 from vektah/strict-config

Strict config

533dcba7 Merge pull request #191 from vektah/nullable-list-elements

Support nullable list elements

  • e0bf6afd Support nullable list elements
0780bf2e Merge pull request #190 from vektah/generated-forced-resolvers

Allow forcing resolvers on generated types

  • bf1823cd Allow forcing resolvers on generated types
febd0358 Merge pull request #186 from vektah/error-redux

Error redux

0.2.5 - 2018-07-13

0a9709db Merge pull request #188 from vektah/fix-windows-gopath

Fix windows gopath issue

0.2.4 - 2018-07-10

ac9e5a66 Merge pull request #180 from vektah/import-alias-before-finalize

Fix a bug custom scalar marshallers in external packages

  • 160ebab5 Fix a bug custom scalar marshallers in external packages
43212c04 Merge pull request #179 from vektah/models-config-error

Improve Output Filename and Package Handling

  • 936bc76e Better handling of generated package name

  • 5d3c8ed2 Inline ImportPath strings

  • fc43a92a Check that exec and model filenames end in *.go

  • 6d38f77d Handle package name mismatch with dirname

  • ebf1b2a5 Add error message when specifying path in package name

  • c8355f48 Check models config for package-only specs

0.2.3 - 2018-07-08

  • 6391596d Add some basic docs on the new config file
a9c3af86 Merge pull request #176 from vektah/config-search-paths

Search for config

bff3356b Merge pull request #175 from vektah/lint-all-packages

gometalinter should cover all packages

  • 61f37173 gometalinter should cover all packages
ce657044 Merge pull request #173 from vvakame/feat-resolver-hint

add resolver option support to field

57b8279e Merge pull request #172 from vvakame/feat-newconfig

switch to .gqlgen.yml

325c45a4 Merge pull request #171 from vvakame/add-gitignore

add .idea/ to .gitignore

0.2.2 - 2018-07-05

f0a08617 Merge pull request #163 from vvakame/feat-types-json

support .gqlgen.yml

faf095fc Merge pull request #166 from vektah/validate-at-end

Validate at end

  • fca1e08e shh errcheck

  • cc78971e Dont show compilation errors until after codegen

  • 9f6ff0cf Convert todo example to new resolver syntax

  • 8577ceab address comment

  • 86dcce73 Add format check to -typemap argument

  • 5debbc6a Implement types.yaml parsing

  • ecf56003 Refactor types.json parsing

b16e8429 Merge pull request #159 from vektah/enum-only-generation

Dont skip model generation if there are enums defined

  • 3f751a40 Dont skip model generation if there are enums defined

  • 588aeacb more tutorial fixes

dc472965 Merge pull request #157 from johncurley/fix-docs-argument

Updated mutation to take correct argument

  • 88a84f83 Updated mutation to take correct argument
404f0b0d Merge pull request #151 from qdentity/fix-longer-gopath

Fix bug with multiple GOPATH full package name resolving

f66e2b3b Fix bug with multiple GOPATH full package name resolving

This commit fixes the bug where GOPATH values that are longer than the input package name cause 'slice bounds out of range' errors.

0.2.1 - 2018-06-26

cb87a2cb Merge pull request #147 from vektah/import-overhaul

Improve import handling

9fa3f0fb Merge pull request #134 from mastercactapus/small-interfaces

add lint-friendly small interfaces option for resolvers

e8c30acd fix template error on generated defaults (#146)
  • fix template error on generated defaults

  • go fmt

  • add test for default fix

  • .

  • add key sort for default values

  • 769a97e2 fix race in chat example test - t.Parallel() doesn't guarantee parallel execution - moved goroutine so the test can execute independently

  • 5b77e4c2 remove deprecation warning for now

  • 59a5d752 remove trailing S

  • b04846f6 fix time race in scalar test

  • a80b720f name updates, deprecation, some code comments

  • 2bbbe054 Merge branch 'master' into small-interfaces

  • 4ffa2b24 case insensitive compare to determine self package

  • c0158f54 make sure colliding imports are stable

  • abf85a10 get package name from package source

  • a39c63a5 remove a random json tag from tutorial

  • f48cbf03 tutorial fixes

0a85d4f2 Update generated headers to match convention. (#139)
  • Update generated.gotpl

  • Update models.gotpl

  • Update data.go

  • update go generate

  • revert code changes

  • 4a6827bd Update getting started guide

  • a21f3273 Use recognized Code generated header

  • 038c6fd2 change from ShortResolver to ShortResolvers - prevents possible collision with an object type named Short

  • 0bc592cd run go generate

  • db2cec07 fix template formatting

  • 59ee1b5c from probably makes more sense

  • 620f7fb4 add "short" resolver interface

0.2.0 - 2018-06-21

d26ef2a2 Merge pull request #136 from tianhai82/master

fix GOPATH case mismatch issue

a34b4de4 Merge pull request #137 from appleboy/patch-1

fix example links

c1cde36c Merge pull request #133 from mastercactapus/skip-type-mismatch

skip struct fields with incompatible types

40d9a11b Merge pull request #127 from jon-walton/windows-path-slash

convert windows input path separators to slash

  • 7db9d122 convert windows input path separators to slash
a5f72601 Merge pull request #122 from vektah/json-encoding-fixes

Fix json string encoding

e9b40666 Merge pull request #123 from vektah/drop-fk-generation

BC Break: Stop generating foreign keys in models

a8419e20 Merge pull request #124 from vektah/fix-backtick-escaping

Fix backtick escaping

  • 47eaff4d Fix backtick escaping

  • a5c02e6c BC Break: Stop generating foreign keys in models

94d5c89e Merge pull request #120 from andrewmunro/bugfix/fix-panic-on-invalid-array-type

Fixing panic when non array value is passed to array type

  • 5680ee49 Adding dataloader test to confirm no panic on malformed array query

  • 55cc161f Fixing panic when non array value is passed to array type

  • 6b3b338d Add gitter link to readme

  • 6c823beb add doc publish script

a25232d8 Merge pull request #113 from mikeifomin/patch-1

Fix typo in url dataloaden

3990eacf Merge pull request #108 from imiskolee/master

generate json tag to model field by gql name.

  • abb7502a 1. run go generate

  • e1f90946 1. add json tag in models_gen.go 2. use gqlname to model filed json tag.

35e09717 Merge pull request #107 from vektah/fix-vendor-normalization

Fix vendor normalization

63ee4199 Fix vendor normalization

When refering to vendored types in fields a type assertion would fail. This PR makes sure that both paths are normalized to not include the vendor directory.

2a437c23 Merge pull request #105 from vektah/keyword-input-args

Automatically add a _ suffix to reserved words

26ac13ff Merge pull request #104 from vektah/new-request-context

Add a NewRequestContext method

  • 309e5c6d Automatically add a _ suffix to reserved words

  • a2fb1421 Add a NewRequestContext method

ab6e65bd Merge pull request #97 from vektah/add-input-defaults

Default values for input unmarshalers

  • 1cd80c4a Default values for input unmarshalers
79c69d15 Merge pull request #96 from vektah/refactor-tests

Refactor tests

0c7bdfc6 Merge pull request #95 from vektah/custom-error-types

Custom error types

22128e0e Merge pull request #93 from vektah/input-type-error-handling

Input type error handling

  • e7539f11 Add an error message when using types inside inputs

  • a780ce69 Add a better error message when passing a type into an input

  • 0424f043 Refactor main so tests can execute the generator

ab3803a6 Merge pull request #89 from vektah/opentracing-parent-span

Add parent opentracing span around root query/mutation/resolvers

d157ac35 Add context to recover func

This makes the request and resolver contexts available during panic so that you can log the incoming query, user info etc with your bug tracker

091d25ab Merge pull request #87 from jon-walton/windows-paths

fix package paths on windows

546b7b76 Merge pull request #84 from yamitzky/master

Fix collectFields to handle aliased fields properly

  • ba2ecb16 Add test case for aliased field

  • 78f3a56c Fix collectFields to handle aliased fields

4d2eece0 Merge pull request #77 from vektah/opentracing

Add resolver middleware Add opentracing support

e266fab9 Merge pull request #75 from mathewbyrne/fix-import-dash

Replace Invalid Characters in Package Name with an Underscore

b0d79115 Replace invalid package characters with an underscore

This will sanatise local import names to a valid go identifier by replacing any non-word characters with an underscore.

66a91503 Merge pull request #72 from vektah/custom-enum

Add support for custom enums

ebcc94d1 Merge pull request #70 from vektah/models-in-separate-package

Allow generated models to go into their own package

  • 9a532131 Allow generated models to go into their own package
6129fd26 Merge pull request #69 from vektah/support-options

Support OPTIONS requests

893ead12 Merge pull request #67 from vektah/raw-schema-string

Use a raw string for schema

c0753bed Merge pull request #66 from vektah/generate-enums

Generate enums

71c4e265 Merge pull request #65 from vektah/context

Make field selections available in context

  • c60336bf regenerate

  • c5ccfe4e Add an example for getting the selection sets from ctx

  • e7007746 add fields to resolver context

  • 40918d52 move request scoped data into context

4e13262e Merge pull request #64 from vektah/vendor-gen-path

Fix vendored import paths in generated models

a508ecb0 Merge pull request #45 from dvic/fix-resolver-public-errors

Retain orignal resolver error and support overriding error message

  • ab4e7010 Retain orignal resolver error and support overriding error message (closes #38)
a05a18d5 Merge pull request #61 from vektah/import-resolver-collisions

Deal with import collisions better

  • d81ea2c2 Deal with import collisions better
fb131a94 Merge pull request #59 from vektah/map-support

Add map[string]interface{} escape hatch

  • 49d92164 Add map[string]interface{} escape hatch
5abdba16 Merge pull request #57 from vektah/null-input-fields

Null input fields

54fbe16a Merge pull request #56 from vektah/getting-started-fixes

Getting started fixes

f3a70dac Merge pull request #55 from vektah/fix-input-ptr-unpacking

Fix ptr unpacking in input fields

  • 10541f19 Fix ptr unpacking in input fields
15b3af2d Fix value receivers for unions too

fixes 42

46103bdc Merge pull request #53 from vektah/docs

Docs

ac832dea Merge pull request #51 from vektah/support-embedding

Support embedding in models

cb34e6db Merge pull request #50 from vektah/valuer-receiver

Don't generate value receivers for types that cant fit the interface

  • ec5f5e66 check for valuer receivers before generating type switch

  • dc898409 add test case

8ef253cb Merge pull request #49 from vektah/default-entrypoints

default to Query / Mutation / Subscription if no entry points are specified

  • 302058a7 Use default entry points for Query/Mutation/Subscription
13949fdf Merge pull request #37 from vektah/generate-interfaces

generate interfaces

e47d5038 Merge pull request #34 from vektah/root-types-only

Only bind to types in the root package scope

  • ffe972a8 Only bind to types in the root package scope
0e78c0ae Merge pull request #33 from vektah/unset-arguments

Allow unset arguments

94718351 Merge pull request #31 from vektah/recover-handler

Customizable recover func

69277045 Merge pull request #30 from vektah/complex-input-types

Fix complex input types

1d074b89 Merge pull request #29 from vektah/multi-stage-model-build

Split model generation into its own stage

  • cf580c24 Split model generation into its own stage
926384db Merge pull request #28 from vektah/default-args

add default args

7b6b124e Merge pull request #20 from vektah/codegen-cleanup

Codegen cleanup

  • 78c34cb3 regenerate

  • 5ebd157c Only use one gofunc per subscription

  • 79a70376 Move generated field resolvers into separate methods

e676abe4 Merge pull request #19 from vektah/generate-input-types

Generate input models too

4feb1689 Merge pull request #18 from vektah/array-input-args

Fix input array processing

4880497f Merge pull request #16 from vektah/better-templates

Better templates

f3731c73 Merge pull request #14 from vektah/autogenerate-models

Autogenerate models

9d896f40 Merge pull request #13 from vektah/autocast

Automatically add type conversions around wrapped types

  • 85fa63b9 Automatically add type conversions around wrapped types
c8c2e40f Merge pull request #11 from vektah/subscriptions

Add support for subscriptions

  • d514b829 Add some go tests to the chat app

  • ec2916d9 chat example for subscriptions using CRA+apollo

  • 8f93bf8d get arg errors working in both contexts

  • 62a18ff1 Update generator to build a new ExecutableSchema interface

  • c082c3a4 prevent concurrent writes in subscriptions

  • f555aec6 switch to graphql playground for better subscription support

  • 18219541 add websocket support to the handler

  • d4c7f3b9 update resolver definition to use channels for subscriptions

d0244d24 Merge pull request #10 from vektah/newtypes

User defined custom types

51292db9 Merge pull request #4 from vektah/cleanup-type-binding

Cleanup schema binding code

030954a5 Merge pull request #2 from ulrikstrid/patch-1

Fix typo in README

b4663703 trace: Log graphql.variables rather than tag

According to the OT documentation tag values can be numeric types, strings, or bools. The behavior of other tag value types is undefined at the OpenTracing level. For example github.com/lightstep/lightstep-tracer-go generates error events.

  • 5d3b13f2 Support context injection in testing
beff0841 Separate literal arg parsing cases (int, float)

This change allows the ID scalar implementation to more semantically handle the case for unmarshalling integer IDs.

ab1dd4b5 Add tests for ID scalar input

This commit adds two tests cases for ID scalar input:

  • a string literal
  • an integer literal

Both of these literal types are covered by the GraphQL specification as valid input for the ID scalar.

Reference the ID section of the spec for more information: http://facebook.github.io/graphql/October2016/#sec-ID

d8c57437 Extract ID scalar implmentation

This change moves the ID scalar implementation out of graphql.go and into its own file id.go for consistency with the Time scalar implementation.

  • 10eb949b cleaned up example to use MustParseSchema
52080e1f Rename friendsConenctionArgs to friendsConnectionArgs

Fix spelling error in friendsConnectionArgs type

  • 3965041f Update GraphiQL interface (add history)
6b9bc3e2 Add `(*Schema).Validate` (#99)
  • Add (*Schema).Validate

This adds a Validate method to the schema, which allows you to find out if a query is valid without actually running it. This is valuable when you have a client with static queries and want to statically determine whether they are valid.

  • Fix Validate doc string
  • 7f3f7120 Set content-type header to application/json

  • c76ff4d8 moved packer into separate package

  • 073edccd updated tests from graphql-js

  • 3a9ac368 validation: improved overlap check

  • f86c8b01 allow multiple schemas in tests

  • 77750960 validation: OverlappingFieldsCanBeMerged

  • e7ca4fde refactor: remove SelectionSet type

  • 7aad6ba7 refactor: use schema.NamedType

  • fddcbcb7 resolves #92: fix processing of negative scalars during parse literals

  • 48c1a0fb Small fix based on feedback.

  • e90d1089 allow custom types as input arguments

  • dd3d39e2 fix panic when variable name not declared

  • c2bc105f validation: NoUnusedVariables

  • 4aff2976 refactor

  • 0933d241 validation: VariablesInAllowedPosition

  • 83e2f31a validation: NoUndefinedVariables

  • c39ffeca validation: PossibleFragmentSpreads

  • 47c5cde7 validation: UniqueInputFieldNames

  • 94cb2918 big refactoring around literals

  • 3d63ae80 some refactoring

  • 969dab9d merged lexer into package "common"

  • a9de6171 renamed lexer.Literal to lexer.BasicLit

  • 88c492bb validation: NoFragmentCycles (closes #38)

  • d39712c8 refactor addErrMultiLoc

  • ee5e1c3b validation: updated tests

  • 490ad6b2 validation: NoUnusedFragments

  • da85f09d add path to errors on resolver error or panic (closes #86)

  • 04cb2550 allow structs without pointers (closes #78)

  • 4c40b305 show all locations in error string

  • 5c26f320 fix limiter

  • dbc3f0a0 fix composing of fragments (closes #75)

213a5d01 Warn if an interface's resolver has a ToTYPE implementation that does not return two values.

Currently this instead crashes fairly inscrutably at runtime here: https://github.com/neelance/graphql-go/blob/master/internal/exec/exec.go#L117

An alternate fix would be to check len(out) there and perhaps rely on out[0] being nil to continue if there's only one return value.

67e6f91d use encoding/json to encode scalars

There are some edge cases that are better handled by the proven encoder of encoding/json, for example special characters in strings.

a9920602 pluggable tracer

Improved performance while keeping flexibility.

aef3d9cf Add testing.go into its own package (gqltesting)

This is done so that "testing" (and especially its registered cli flags) aren't included in any production builds.

cdef8563 removed SchemaBuilder

It is not necessary any more. Simpler API wins.

518a5fe7 Merge pull request #45 from nicksrandall/master

fix wrong import statement

1d03e667 refactor: new package "common"

package "query" does not depend on "schema" any more

  • 1a959516 refactor

  • f8cb11c1 example/starwars: use interface base type to make type assertions nicer

  • 746da4b8 star wars example: friendsConnection

  • bec45364 parse type in query

  • be87a8fa remove unused code

  • 042e306a simpler way to resolve type refs in schema

  • 7cbf85fb improved type checking of arguments

  • 2b6460ae type check for scalars

  • 17034fe7 improved null handling

  • e6b6fbca small cleanup

  • 7b8cd1bc meta schema from graphql-js

  • 9333c0b3 introspection: inputFields

  • c4faac56 introspection: ofType

  • 86da8492 introspection: interfaces and possibleTypes

  • 20dbb845 proper nil support for lists

  • 2e3369ae resolve types in schema package

  • 7da95f4a introspection: enum values

  • cb423e6e improved handling of scalar types

  • 5b07780f introspection: original order for fields and args

  • 1e2d180c introspection: arguments

  • f21131bb refactored schema to be more in line with introspection

  • 0152d4f2 introspection: currently no descriptions and deprecations

  • ad5689bb field introspection

  • 2749d814 removed query.TypeReference

2eb105ec Revert "resolve scalar types in exec"

This reverts commit fb3a6fc969b0c8c286c7d024a108f5696627639c.