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>