Skip to content

Commit

Permalink
Merge pull request #187 from Netflix/spring-graphql-docs
Browse files Browse the repository at this point in the history
Update context contributor docs.
  • Loading branch information
srinivasankavitha authored Aug 14, 2024
2 parents 8dcf44f + 819284f commit fd4189a
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 3 deletions.
57 changes: 57 additions & 0 deletions .idea/jsonSchemas.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/tbe-PST.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/advanced/graphqlcontext-leveraging.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ is now the approved context mechanism (replacing the previously used opaque Cont
via key/value pairs to provide frameworks and userspace code the capability to contribute, share and leverage various
pieces of context independent of each other.

Note that if you simply require interception/modification of request and response headers, you can use a `WebGraphQlInterceptor` provided by Spring GraphQL as described [here](intercepting-http-request-response.md).

To make this easily leverageable by DGS customers, a new interface has been provided for which any Spring Beans registered
that implement the [`GraphQLContextContributor`](https://github.com/Netflix/dgs-framework/blob/master/graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/context/GraphQLContextContributor.kt)
interface, their `contribute` method will be invoked before any normal instrumentation classes are invoked, allowing
Expand Down
6 changes: 3 additions & 3 deletions docs/advanced/intercepting-http-request-response.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Response Instrumentation
The DGS framework internally uses [GraphQL Java] and [Spring for GraphQL].
# Request and Response Header Instrumentation
The DGS framework internally uses `GraphQL Java` and `Spring for GraphQL`.

If you need to modify the HTTP request and response headers, you can leverage the `WebGraphQlInterceptor` in [Spring for GraphQL] (https://docs.spring.io/spring-graphql/reference/transports.html#server.interception) to accomplish this.
If you need to modify the HTTP request and response headers, you can leverage the `WebGraphQlInterceptor` in [Spring for GraphQL](https://docs.spring.io/spring-graphql/reference/transports.html#server.interception) to accomplish this.
This provides a hook to update the request and response headers based using the `GraphQLContext`

#### Example:
Expand Down

0 comments on commit fd4189a

Please sign in to comment.