gqlgen v0.11.0 Release Notes

Release Date: 2020-02-17 // about 4 years ago
    • ๐Ÿš€ 368597aa release v0.11.0

    โšก๏ธ e65d6228 Merge pull request #1036 from 99designs/update-v011-docs

    โšก๏ธ Update 0.11 migration docs

    • โšก๏ธ 11f97936 Update 0.11 migration docs

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

    Trim underscores from around go identifiers

    • โšก๏ธ b2d9bfcb Update stale.yml

    • โšก๏ธ 1ac8b5ae Update stale.yml

    • 4b9dfa61 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 https://github.com/vektah/gqlparser/pull/117

    • ๐Ÿ“œ cf6f7683 bump to gqlparser v2

    ๐Ÿ”€ 4ece3857 Merge pull request #1028 from abhimanyusinghgaur/master

    ๐Ÿ—„ Respect includeDeprecated for EnumValues

    • 9638ce0f Fix format

    • 51b921fa Fix format

    • ๐Ÿ—„ 07ffcc82 Respect includeDeprecated for EnuValues

    • d58434c9 propagate resolver errors to response error in ResponseMiddleware

    • 59855925 go mod tidy

    • ๐Ÿ“œ e4530da6 apply https://github.com/vektah/gqlparser/pull/117

    ๐Ÿ”€ 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

    • ๐Ÿ‘ 2f0fa0ef handle schema loading error better

    • ๐Ÿšš aacc9b1f Remove source reprinting

    ๐Ÿ”€ e289aaa0 Merge pull request #1018 from 99designs/federation-docs

    ๐Ÿ“„ Federation docs and examples

    • ๐Ÿ“„ 3045b2cf 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

    • 6bf88417 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

    • 0๏ธโƒฃ 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.
    • 4e95b363 fix some version switcher paths

    • 08369dfe add missing trailing slash on paths

    • ea347ca7 fetch all tags

    • 8c1a8f57 fix branch switching

    • 324efc5c add origin if missing

    • ๐Ÿ“„ cfa2907a Generate docs for all tags

    ๐Ÿ”€ 8218c734 Merge pull request #851 from marwan-at-work/federation

    Apollo Federation MVP

    • 48dc29c1 go 1.12 generate, 1.14 failed

    • โšก๏ธ b2e81787 update gqlparse to v1.2.1

    • โšก๏ธ d2a13d33 update go.mod

    ๐Ÿ”€ 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:

    • db499561 force rebuild

    • ๐Ÿšš 0985a78e remove debug comments

    • โœ… 7f648425 add preliminary test_data

    • โœ… c9d6d94b add preliminary tests

    • 2345936e fix integration

    • aae7486d go generate

    • ๐Ÿšš 555a9546 go generate + remove directives nil check

    • 368d546d Apollo Federation MVP

    • 21e0e676 Fix extra trimspace on nillable Unmarshals

    • ๐Ÿšš f869f5a8 remove deprected handler call

    • ๐Ÿ”€ f0b83cb1 fix merge conflict

    • โšก๏ธ cdf96721 update generated code

    • 21356ce3 markdown cleanup

    ๐Ÿ”จ 412a72fe Merge pull request #885 from 99designs/handler-refactor

    ๐Ÿ”จ Refactor handler package

    • bac79c54 force clean git checkout

    • ๐Ÿ“„ dca9e4a5 Add migration docs

    ๐Ÿ”€ 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

    • 0๏ธโƒฃ 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

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

    <!-- end of If NoteGroups -->