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:
- ๐ Apollo federation spec: https://www.apollographql.com/docs/apollo-server/federation/federation-spec/
- Selection sets: https://graphql.github.io/graphql-spec/draft/#sec-Selection-Sets
โก๏ธ 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 -->