Any way to configure allowedOrigins on the graphql servlet for Cors requests?
See original GitHub issueFirstly, big thanks for putting this altogether! Saved me a huge amount of time already.
From what I can see in GraphQLWebAutoConfiguration
with graphql.servlet.corsEnabled=true
uses the default permit all:
CorsConfiguration corsConfiguration = new CorsConfiguration().applyPermitDefaultValues();
Am I missing where I can configure the allowedOrigins for Cors requests through config or is this not currently supported?
Cheers
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Enable CORS origin graphql - spring boot - Stack Overflow
For local development you may need a CorsFilter bean to enable your local origin: @Configuration @Profile("local") public class ...
Read more >Configuring CORS - Apollo GraphQL Docs
This feature requires that any client sending operations via GET or multipart upload requests must include a special header (such as Apollo-Require-Preflight ) ......
Read more >graphql-java-kickstart/Lobby - Gitter
I need to support queries and subscriptions. I'm a little lost on how to do that. Do I need to have both a...
Read more >graphql-java-kickstart / graphql-spring-boot Download - JitPack
Enable GraphQL Servlet ; Enable GraphiQL; Enable Altair; Enable GraphQL ... /graphql cors-enabled: true cors: allowed-origins: http://some.domain.com ...
Read more >UrlBasedCorsConfigurationSource.setAlwaysUseFullPath
How to use ... Best Java code snippets using org.springframework.web.cors. ... origin: com.graphql-java/graphql-spring-boot-autoconfigure ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Mrman You could try it out already with snapshot 7.1.0-SNAPSHOT if you want to. Just add the snapshot repository to your project: https://github.com/graphql-java-kickstart/graphql-spring-boot#snapshots.
@Thinkenterprise It’s just by chance I’m seeing this comment on the closed issue, but we generally don’t notice these. Since we’ve enabled Discussions on the projects, best next time to ask the question there and link it to this issue.
Having said that I’m not sure what’ll happen when you configure it using
WebMvcConfigurer
. When using the configuration options as provided by the library it’ll create aCorsFilter
bean which is used to protect the servlet.