Skip to content

Releases: wundergraph/graphql-go-tools

Add variables to the proxy

12 May 11:30
5c6d04a
Compare
Choose a tag to compare

This PR adds the capability of handling variables to the proxy.
Variable definitions will get parsed and printed as well as proxied to the backend.
Variables defined in the request JSON will be proxied to the backend too.

Thanks to @mvid for contributing this feature!

Changelog

9a842a5 Merge branch 'master' into bug/73-query-variables
ed0d3c6 Merge pull request #72 from jensneuse/bug/66-swallowed-err
5c6d04a Merge pull request #74 from jensneuse/bug/73-query-variables
354708c Merge pull request #76 from jensneuse/bug/75-dropping-signature
97912a6 another test
bdcbf51 apply formatting and delete unnecessary duplicates
7dd1352 apply gofmt
8c03ca1 apply slight structural change to test
25ec954 fix test description vom plural to singular
607e599 handle DispatchRequest error in a non-silent way
476e61e linting
79bff9b make iterator signature match the other implementations
e19b916 missing fixtures added
b7e607f pass variables along with outgoing request to backend graphql server
d9b9be3 proxy failure regression test
37d16db test for variable proxy
1b2a6be use existing type printing function
7da12db variable definitions in printer

v1.6.2

12 May 11:35
5c6d04a
Compare
Choose a tag to compare

Changelog

9a842a5 Merge branch 'master' into bug/73-query-variables
ed0d3c6 Merge pull request #72 from jensneuse/bug/66-swallowed-err
5c6d04a Merge pull request #74 from jensneuse/bug/73-query-variables
354708c Merge pull request #76 from jensneuse/bug/75-dropping-signature
97912a6 another test
bdcbf51 apply formatting and delete unnecessary duplicates
7dd1352 apply gofmt
8c03ca1 apply slight structural change to test
25ec954 fix test description vom plural to singular
607e599 handle DispatchRequest error in a non-silent way
476e61e linting
79bff9b make iterator signature match the other implementations
e19b916 missing fixtures added
b7e607f pass variables along with outgoing request to backend graphql server
d9b9be3 proxy failure regression test
37d16db test for variable proxy
1b2a6be use existing type printing function
7da12db variable definitions in printer

v1.6.1

14 Apr 09:21
b12e8b8
Compare
Choose a tag to compare

Changelog

c18ac36 Merge pull request #61 from jensneuse/cleanup
b12e8b8 Merge pull request #62 from jensneuse/add-byteslices-single-linked-list
05a71b0 add bootstrap to 'make ci'
58e7088 add formatting
57150e8 cleanup go mod
54e84c5 fix order in tests
6b44f61 make parser implement ByteSliceReferenceGetter
7ac172b refactor parseImplementsInterfaces to use ByteSliceReferences
d412422 replace []int with ByteSliceReferences for NodeImplementsInterfaces
c75d273 simplify circle ci config
b67b417 update fixtures
1c5258a update lookups for ByteSliceReferences
af9079c update parser testhelper to use ByteSliceReferences

v1.6.0

07 Apr 16:03
41284b8
Compare
Choose a tag to compare

Changelog

b5158bc Merge pull request #54 from jensneuse/proxy-backend-headers
ec82450 Merge pull request #55 from jensneuse/optional-operation-name
99d4d14 Merge pull request #59 from jensneuse/10-undefined-types-in-middlewares
41284b8 Merge pull request #60 from jensneuse/migrate-to-go-mod
87f569f add ExtendTypeSystemDefinition to parser
2dd150d add ExtendTypeSystemInput to the lexer so that modifications after the initial parsing are possible
a6b26f6 add PrepareSchema func to GraphqlMiddleware interface which enables a middleware to modify the schema before execution
2f7e2a1 add calling PrepareSchema on all middlewares to the invoker before executing OnRequest
ef672da add formatting
c2a7cdd add formatting
43ad297 add go.mod and go.sum
523399f add golangci-lint @v1.16.0 dependency
b318280 add golangci-lint to circle ci config
998e9b1 add headers to request config, for application on requests to the backend servers
004c9ab add seperate test data for testing the validation middleware
de5a2d3 add tests for extending the type system definition
c402039 add tests for type system definition extension
d798762 add tests to the lexer for ExtendTypeSystemInput
5045f99 cleanup Makefile and invoke ci testing via makefile
09cb625 drop gometalinter from ci
839682a fix circle ci yaml
376a170 fix linting errors
6880877 fix typo
0fbba3f implement PrepareSchema for context middleware
05bff2a implement PrepareSchema for the asset middleware
3fef22b implement PrepareSchema for validation middleware
09fc03e remove blank operation name from tests
b19f5cc remove gometalinter config
fe92a3e remove now unnecessary declaration of the context middleware directive directly in the schema
9a9b08d remove vendor
c6c8ce0 remove yoda conditions from test code
73fc869 simplify parsing type system definition / executable definition
6fae05e simplify the helper method InvokeMiddleware by using the invoker
e204944 this commit fixes a potential included empty operation name, which can cause problems with older graphql implementations
52803a2 update README adding paragraph on go version and go modules
aea058e update circle ci config to use golang 1.12 and drop working directory
98a080b update lexer mock after adding ExtendTypeSystemInput

v1.5.0

01 Apr 19:34
8b22931
Compare
Choose a tag to compare

Changelog

11c7746 Merge branch 'master' into cleanup
f1fbba7 Merge branch 'proxy-update' of https://github.com/mvid/graphql-go-tools into mvid-proxy-update
8614eaa Merge pull request #43 from jensneuse/mvid-proxy-update
2ffd759 Merge pull request #45 from jensneuse/cleanup
3ba40ab Merge pull request #46 from jensneuse/parser-accept-comments
b8774f0 Merge pull request #47 from jensneuse/44-scaling-ParseTypeSystemDefinition
f8fc21e Merge pull request #50 from jensneuse/mvid-proxy-update
8b22931 Merge pull request #52 from jensneuse/55-context-middleware-quote-input
d58a6b1 Proxy Update: Contexts
eb214ca add InputValueDefinitions (single linked list iter) struct to document package
0666a77 add SetContextValues to http proxy so that the context middleware works in e2e tests
abf57b9 add big schema benchmark
f46e273 add big schema test data
c5f1d03 add formatting
e1f04a4 add formatting
10a71d4 add formatting
4164c52 add lexer test for comments with hashtag
d5616ef add meaningful error message in case a context value is missing
89fb8b3 add more tests including escaped quotes inside the string
ac62361 add test to parser for comment parsing
01dd657 add tests to ensure string quoting
59cbfa3 change signature for NodeFieldsDefinition from []int to FieldDefinitions iterator
cec16da change signature of EnumValueDefinitions from []int to single linked list iterator
153835b change signature of InputValueDefinitions from []int to InputValueDefinitions struct
c959beb delete deprecated code
733ad03 fix lookup test
c5a2980 fix lookup test
4e8f4f9 fix printer test to correctly report errors
2b86468 fix test to reflect new structure
027d9a5 fix testhelper
f3b29a2 fix tests to reflect structural changes
b2e7ec6 implement EnumValueDefinitions iterator
c511271 implement FieldDefinitions iterator
7a7b078 implement comment with hashtag lexing
88e7c6e make context middleware accept strings or a byte slice as argument value
a25d939 make parser accept comments
3fff84c make parser accepts comments
1587d35 make the quoting aware of having pre or suffixed quotes
fd23772 make walker use ParsedDefinition instead of references on the TypeSystemDefinition which got removed
9c4b7d7 make walker use the new FieldDefinition iterator
2846ebe merge master
546ec4b out comment debug info
7a521d9 proxy updates
2931ee9 refactor arguments definition parsing to use InputValuesDefinitions struct
0a12d0d refactor context middleware to quote string/slice inputs if they weren't already quoted
11457b2 refactor input fields definition parsing
7880b21 refactor input value definitions parsing to return InputValueDefinitions struct
816e26f refactor lookup to implement EnumValueDefinitionGetter
20fbd50 refactor lookup to use InputValueDefinitions
a74cc7f refactor lookup to use the FieldDefinitions iterator
012983c refactor parseFieldDefinitions to return FieldDefinitions instead of []int
d3cdfc7 refactor parseInterfaceTypeDefinition to use FieldDefinitions
2b5f3cd refactor parseObjectTypeDefinition to use FieldDefinitions
b4f88a0 refactor parser to use EnumValueDefinitions iterator
64c18f2 refactor printer to use EnumValueDefinitions iterator
a12e30f refactor printer to use FieldsDefinition iterator
75823b3 refactor readComment: remove the need to peek makes it faster
78058a4 refactor type switching
6dd0fd3 refactor validation to use InputValueDefinitions
482641b refactor walker to use InputValueDefinitions
bcebd0f removal of duploate test
d077686 remove TypeSystemDefinition from Node interface
ffc7c2a remove deprecated code on initTypeSystemDefinition
3f341a6 remove newline at err end
8791038 remove printMemUsage from test
59051fd remove unused code
3ccfe1e rename NewStaticSchemaProvider to NewStaticRequestConfigProvider
84d3cb0 replace []int with FieldDefinitions in InterfaceTypeDefinition
28c0ec5 replace buffered reader with io.copy
f197e82 replace fasthttp proxy in staticProxy cmd with http proxy
e1fe3bf simplify configuration of staticproxy
18d4050 simplify fast static proxy configuration
ebd3c47 simplify type system definition parsing as indexes on typeSystemDefinition struct got removed
32ed4ac update fast static proxy tests
4bc9792 update fixtures to reflect removed code changes
783b19b update parser object cache structure to use EnumValueDefinitions Iterator
686ff3e update parser to use the new structure and implement FieldDefinitionGetter
c287bb8 update printer to use InputValueDefinitions
ca0b71d update staticProxy cmd to reflect changes to the proxy config structure
627e311 update structure of ParsedDefinitions, remove argumentsDefinition/inputFieldsDefinition initializer
eaff368 update tests
67b797c update tests and fixtures
ef3fba7 update tests and fixtures because the field order changed
ac88959 update validation to use the FieldDefinition iterator

v1.4.0

24 Mar 17:42
120b8c5
Compare
Choose a tag to compare

This release adds the "staticProxy" cmd.
Static proxy is a ready to use configurable proxy.
The proxy (currently) works with a single backend.
In the current version it comes with 2 features:

  1. Validation (validates queries against a schema)
  2. Context Middleware (rewrite query Arguments based on request headers)

The lexer now supports an input up to 1.000.000 Byte. (Could be configured to more, would increase memory usage).

I've removed a few bottlenecks so that the proxy is able to parse 500kb schema's on a modern CPU in < 10ms. Small schemas (<50kb) can be parsed in <1ms. Query parsing and validation is usually <1ms.
This makes the library/proxy a good fit if the schema is not known ahead of time. So it's definitely possible to fetch the schema at request time, parse it and then proceed with the request.

v1.3.0

18 Mar 17:19
3b6a6aa
Compare
Choose a tag to compare

This version adds initial support to build a graphql proxy. To illustrate possible use cases a context based middleware was added. It's intended to rewrite graphql queries based on the request context in combination with schema annotations via directives.

v1.2.2

06 Mar 07:42
Compare
Choose a tag to compare

Changelog

98b4e16 WIP fix goreleaser cfg
e00894e remove unnecessary statement

Fix printer package placement

02 Mar 13:30
bda7853
Compare
Choose a tag to compare
Merge pull request #21 from jensneuse/fix-printer-path

Fix printer path

add ast printer

02 Mar 12:14
9b686be
Compare
Choose a tag to compare

This Release introduces the printer api.
It currently supports to print executable definitions.
Indentation is not yet implemented because the very first version of the printer is intended to be used only by computers.
Having the printer in this repo enables one to parse and validate an executable definition, modify it and print it out. This can be used e.g. to write a graphql proxy for rewriting queries.