Releases: wundergraph/graphql-go-tools
Move to new organization, Add repeatable directives, Bump dependencies
What's Changed
- Bump follow-redirects from 1.14.1 to 1.14.9 in /examples/chat by @dependabot in #351
- Bump url-parse from 1.5.1 to 1.5.10 in /examples/chat by @dependabot in #352
- playground: Change to use stdlib embed instead of packr by @tmc in #360
- Bump async from 2.6.3 to 2.6.4 in /examples/chat by @dependabot in #365
- fix plain renderer for string types by @jensneuse in #369
- Feature/add repeatable directives by @jensneuse in #370
- migrate to new repository by @StarpTech in #371
New Contributors
- @tmc made their first contribution in #360
- @StarpTech made their first contribution in #371
Full Changelog: v1.51.0...v1.52.0
extend normalization
It's now possible to remove unused variables via normalization using extra options.
(currently used in the GraphQL DataSource to avoid sending invalid queries to upstreams)
v1.12.0: fix aliased GraphQL operations (#246)
* fix idle pconn fatal error * add index method remove node by name add ast method replace root operation type definition add ast method remove object type definition * add normalization with retry to grapqhl datasource * add code for extracting nested children and arguments (#95) * move code for determine child nodes * add function to find all field arguments * add lookup functionality * fix linter errors * add recursion stop condition (#96) * fix review comments Co-authored-by: Sergey Petrunin <spetrunin@users.noreply.github.com> * fix being unable to reuse arguments for rest * refactor to planning behavior struct * fix error when no planner is provided * remove unused code * enforce dot as first non-space character in templates (TT-1769) (#98) * enforce dot as first non-space character in templates * extend test cases * change request.header to request.headers * add a failing test for alias in schema * add logic to allow DataSourcePlanners to rewrite downstream field aliases Co-authored-by: Sergey Petrunin <neyasut@gmail.com> Co-authored-by: Sergey Petrunin <spetrunin@users.noreply.github.com> Co-authored-by: Patric Vormstein <pvormstein@googlemail.com>
v1.11.1
v1.11.0
v1.9.1: sync with tyk master (#240)
* Add datasource hooks (#67) * add hooks for graphql datasource * add graphql hooks to the contract * add hooks for http json data source * add hook test for http json * fix tests * fix extracting variables with multiple queries on contract (#71) * implement root field depths (TT-204) (#72) * provide per root field complexity * change internal complexity return values * wip: per field complexity * implement per root field complexity * fix linter errors * change namings according some PR remarks * Fix/tt 571 update field depth calculation (#73) * rename operation_complexity.FieldComplexityResult to RootFieldStats fix depth calculation for the root fields * remove unnecessary allocations * reset counters after living root field (#75) * Feat/add introspectionhelper to graphql (#74) * add node modules to gitignore * add IsIntrospectionQuery to graphql.Request * add IntrospectionResponse to graphql.Schema * add detecting introspection query without name * add more safe conditions Co-authored-by: Sergey Petrunin <sergey@tyk.io> * fix detecting introspection (#76) add data root field to introspection response * add helper introspection as an execution result (#77) * implement missing subscription and websocket protocol parts (TT-904) (#78) * send complete on unsubscribe * update tests and function returns * add ability to execute non-subscription query * add test for server returning error on invalid queries * add buffer pool * expose some websocket functionality * fix potential issues with websocket handler * go fmt & imports * fix build * fix websocket client cleanup websocket client test * add tests for operation selection * fix operation name selection * add error cases * add compatibility for go 1.12 * use WithContext correct * refactor OperationNameExists function * iterate root nodes instead of operation definition as it could lead to bugs * select number of operations in document from rootnodes * update deps * introduce EngineV2Configuration * introduce EngineResultWriter * implement engine execution with first test * refactor tests * port all v1 tests to v2 * add benchmark for v2 * use context.Background instead of nil * fix typo * change writer to flush writer * introduce engine executor abstraction for subscriptions * add function to get operation type from graphql request * improve errors in graphql package * fix typo * revert typo * rearrange handler test * implement websockets for engine v2 * fix small issues * fix broken test * add hooks implementation for v2 (#85) * remove comments * implement hook context with path (#87) * implement hook context with path * fix matching issue Co-authored-by: Patric Vormstein <pvormstein@googlemail.com> * Feat/implement header injection (#88) * implement resolving header from request * implement header injection * fix subscription initialization * fix planning for nested datasources * add test for current implementation * add function to check for blocked and allowed fields * add missing type in enum * rename test lists correctly Co-authored-by: Patric Vormstein <pvormstein@googlemail.com> Co-authored-by: Sergey Petrunin <spetrunin@users.noreply.github.com> Co-authored-by: Sergey Petrunin <sergey@tyk.io>
v1.10.0: go 1.12 compat, planner fix, websocket fix (#236)
* Add datasource hooks (#67) * add hooks for graphql datasource * add graphql hooks to the contract * add hooks for http json data source * add hook test for http json * fix tests * fix extracting variables with multiple queries on contract (#71) * implement root field depths (TT-204) (#72) * provide per root field complexity * change internal complexity return values * wip: per field complexity * implement per root field complexity * fix linter errors * change namings according some PR remarks * Fix/tt 571 update field depth calculation (#73) * rename operation_complexity.FieldComplexityResult to RootFieldStats fix depth calculation for the root fields * remove unnecessary allocations * reset counters after living root field (#75) * Feat/add introspectionhelper to graphql (#74) * add node modules to gitignore * add IsIntrospectionQuery to graphql.Request * add IntrospectionResponse to graphql.Schema * add detecting introspection query without name * add more safe conditions Co-authored-by: Sergey Petrunin <sergey@tyk.io> * fix detecting introspection (#76) add data root field to introspection response * add helper introspection as an execution result (#77) * implement missing subscription and websocket protocol parts (TT-904) (#78) * send complete on unsubscribe * update tests and function returns * add ability to execute non-subscription query * add test for server returning error on invalid queries * add buffer pool * expose some websocket functionality * fix potential issues with websocket handler * go fmt & imports * fix build * fix websocket client cleanup websocket client test * add tests for operation selection * fix operation name selection * add error cases * add compatibility for go 1.12 * use WithContext correct * refactor OperationNameExists function * iterate root nodes instead of operation definition as it could lead to bugs * select number of operations in document from rootnodes * update deps Co-authored-by: Patric Vormstein <pvormstein@googlemail.com> Co-authored-by: Sergey Petrunin <spetrunin@users.noreply.github.com> Co-authored-by: Sergey Petrunin <sergey@tyk.io>
v1.9.0: implement engine (#231)
* remove broken test for this branch * add introspection query to starwars package * add test vor introspection query validation * split creation of RootOperationTypeDefinition function * simply function for addition * implement addition of __schema and __type field for introspection * use internal introspection query * normalize introspection query * introduce normalization result * update to new normalization contract * implement initial default complexity calculator * add initial depth calculation * fix depth calculation * add complexity result instead of bare int variables * make test more readable * remove duplicated code * WIP planning * rename AddTypeNamed to AddNamedType * update Makefile * update deps * initial version of planner * rename ResolveTypeName to ResolveTypeNameBytes * add field aliasing * add test for Operation with multiple Queries * WIP GraphQL DataSource * add graphql data source testing for Load * add visitorFilter to walker * WIP graphql datasource * wip graphql data source * add VariableValueNameString to ast.Document * simplify resolveVariables * print operation name when operation has variables * WIP graphql data source * fix all tests * simplify variables handling * simplify adding arg to field * simplify applyFieldArgument * fix tests * more complex graphql datasource test * more complex testing * rename DataSourceConfiguration to FieldConfiguration * add static datasource * resolve string without path correctly * add http json datasource * plan object argument resolving * implement proper argument resolving * extract FieldMappings into own config object on DataSourceConfigurations * update test version to 1.13 and 1.14 * field argument resolving * update graphql datasource to support two upstreams side by side * add overlapping testcase * add second overlapping test * re-use arguments for upstream graphql requests if an argument is already defined * WIP nested data source planning * WIP update tests * fix copy err * implement parallel fetch * add correct mock tests for complex resolver test, fix string quoting * fix allocation when resolving variables * add func to check if variable definition exists on operation definition * add func to generate unused variable definition name on operation definition * implement object field arguments for graphql upstreams * formatting * add func to ast to check if a selection set contains a field selection with a given name or alias * add capability to planner to delegate field path overrides to data sources * implement lists correctly * add base_url attribute to http json data source * bugfix: enum in resolve plan now string instead of object * bugfix: add wrapping string variables in quotes * add fast http json data source * add singleflight pattern for datasource load * move wg done after deletion from inflight map * remove inflight pool * make explicit copy of result when using singleflight * make singleflight configurable * refactor singleflight fetch to reuse resources * make singleflight configurable from the datasource planner * merge fast & net httpjson datasource into one ds with a client interface * refactor datasources to use one single http client which is injectable * rename url in httpjsondatasource params to path * add query params to httpjson data source * move subscription mock client to tests * implement querystring for net & fast http client * rename object field and field argument json fields * add todo for validation check on field dependencies * refactor field dependencies * WIP refactor datasources * refactor httpclient for datasources * make pool package importable * wrapQuotes for anonymous queries too * fix wrapQuotesIfString with JSON objects * wrapQuotes for anonymous queries too * fix arguments parsing * set content type headers on fasthttpclient * content type headers * fix content type headers * fix content type headers * fix content type headers * implement gzip * fix merge conflicts * add test for multiple query params with same name * add 2 failing tests * feat: enable array query params * implement array params for http json data source * reset active ds planner on enter document * abort graphql planner in case it doesn't get activated * add logging to fasthttpclient * remove optional variables from upstream requests * fix array query params * log response body * fix array query params * implement planning nullable fields correctly * make prepared inputs unique per request * fix array resolving for scalars without a path * fix bug where multiple graphql operations with the same upstream resulted in a panic * implement fastbuffer for resolver * fix resolving bugs * set headers on graphql data source * fix TypeValueNeedsQuotes to work for custom types * skip variable extraction if argument contains a variable * verify variables correct * fix variable validation for nested variables * add nested test for ast validation * skip directives for variable extraction * use correct object values index * allow inline argument values in graphql datasource * draft implementation of subscriptions * add mvp subscriptions impl to engine * remove unused code * resolve arrays correctly * allow nested data source * add variable quoting for enums when preparing variables * add unique identifier to datasource config so that nested resolvers of different upstreams can be distinguished * filter for field name too * filter for field name too * filter field name correctly * remove unused var * remove unused var * implement MVP http polling graphql subscriptions * add skip publish same response to http polling stream * fix ineffecturl assign * fix ineffecturl assign * reset subscription config on enter document during planning * set operation type always to Query on graphql datasource in case of a root field nested in another query * set operation type always to Query on graphql datasource in case of a root field nested in another query * fix validation for variables used in array objects * fix graphql query planner for variables in array object args * make copy of trigger input * extend trigger manager test * cleanup trigger manager * cleanup trigger manager * fix http polling test * migrate subscription impl to channels (#229) * migrate subscription impl to channels * fix tests * WIP add graphql subscription support * add dedicated websocket client * graphql subscriptions impl done * try passing test * add more tests * add go 1.15 for tests * add query planner impl for graphql subscriptions * extract graphql subscription response from data object before pushing to resolver * formatting * remove macos from build matrix * add StreamingResponsePlan skaffold * prep defer tests * add new literals * implement defer * fix tests * add defer postprocessor * add more tests to defer postprocessor * add test for default Processor * set Context nil on Free * implement stream resolving * add postprocessing for stream * add stream to planner * fix add path for array elements in json patch * cleanup stream and defer planning * propagate FlushInterval * cancel streaming resolver if client disconnects * fix tests * add ast printer test for correct spacing * remove input template segmenting from planning stage * refactor ast.Index to allow multiple root Nodes with the same name * add ProcessDataSource to postprocess for template segmenting * add federation resolver test * remove obsolete test * fix printing directive definitions * fix typo * add federation package to generate federation schemas based on a base schema and the service sdl * add federation test for postprocessing * formatting * fix http client json variable quote wrapping * update graphql datasource to properly normalize federation upstream queries * properly implement nested fields resolving * add more complex test * add more tests * add planv2 package with initial plan impl * add plan kind analyzer * initial version of query planner * implement disallow singleflight for mutations * implement nested resolver * implement required fields * implement recursive variables * add test for nested object with variables * implement subscriptions * implement federation * add graphql datasource implementation * implement all tests for http json datasource * rename ds packages * rename ds packages * fix static data source * fix all tests * make tests deterministic * add config loader * remove obsolete code Co-authored-by: Patric Vormstein <pvormstein@googlemail.com> Co-authored-by: Sergey Petrunin <sergey@tyk.io> Co-authored-by: Sergey Petrunin <spetrunin@users.noreply.github.com> Co-authored-by: Alexander Jandousek <alexander.jandousek@yahoo.de>
v1.8.2
The proxy now safely handles a failing RequestConfigProvider.
This enables applications to use dynamic RequestConfigProviders, e.g. a network bound source like Redis, where errors might occur.
Changelog
76960ac Merge pull request #84 from jensneuse/feature/requestconfigprovider-return-err
321217f add test for a failing request config provider
40d2dae make RequestConfig return value optional (pointer) & add err return value
97d81ff update fasthttpproxy to handle RequestConfigProvider errors
770a80c update proxy http handler to handle RequestConfigProvider errors properly
v1.8.1
With this release proxy tests are now structured in a way to enable easy extensibility of the proxy.
Changelog
34a9a7b Merge pull request #83 from jensneuse/feature/simplify-proxy-tests
ee93d93 add comments to RequestConfig and RequestConfigProvider to make them easier to understand
072951f delete replaced test
70b268a refactor all proxy tests into a structured scheme with better reusability
7af2ce7 refactor existing proxy tests to use a structured testing format