Zhen Yee
10/31/2022, 7:43 PMgraphql-kotlin-spring-server . We are using the library for one of our service and we want to differentiate the playground calls vs regular api calls to our endpoint /graphql
Is there a way to do this? Or is there a way to add some configuration to add a custom header for playground requests to help us differentiate these calls?
The context is that some clients are calling our /graphql endpoint and we would like to block direct calls to that endpoint but not block the playground which calls the same endpoint.
Any help is appreciated,
Thank youDariusz Kuc
10/31/2022, 9:04 PMgraphql-playground.html to your project
2. update settings to specify global header here -> (https://github.com/ExpediaGroup/graphql-kotlin/blob/master/servers/graphql-kotlin-spring-server/src/main/resources/graphql-playground.html#L53), see https://github.com/graphql/graphql-playground#properties
3. Disable default playground round and create your own instead (see https://github.com/ExpediaGroup/graphql-kotlin/blob/master/servers/graphql-kotlin-[…]ediagroup/graphql/server/spring/PlaygroundRouteConfiguration.kt)
4. Add some WebFilter to your server to inspect incoming requests and look for expected headerZhen Yee
11/01/2022, 6:12 PMZhen Yee
11/01/2022, 8:25 PMglobalHeaders is not being reflected in the playground. In my graphql-playground.html I set the globalHeaders to some value (see screenshot) but incoming requests are not showing that header. I noticed that in playground settings the globalHeaders are not showing up like the ones defined in the html. But if I change the globalHeaders in playground settings, I will see the header in my WebFilter.
Do you know what the issue might be?Dariusz Kuc
11/01/2022, 8:29 PM