Commit Graph

230 Commits

Author SHA1 Message Date
Rossen Stoyanchev
16ee8ecde0 Add link to samples from top-level README 2021-07-06 16:23:28 +01:00
Rossen Stoyanchev
72ee49269f Polishing 2021-07-06 16:18:09 +01:00
Brian Clozel
289f4d0bac Simplify security samples
As of gh-81, specific security components are contributed by the
GraphQL Security auto-configuration.

This commit removes those from the custom SecurityConfig classes.
2021-07-06 17:02:38 +02:00
Brian Clozel
f1bc239b57 Add Spring Security auto-configuration
This commit adds two new auto-configuration classes that provide the
relevant Spring Security infrastructure for GraphQL applications:

* a `ThreadLocalAccessor` that propagates the security context in
Spring MVC applications
* `DataFetcherExceptionResolver` implementations that resolve security
  exception from data fetchers, for both MVC and WebFlux

Closes gh-81
2021-07-06 16:58:34 +02:00
Brian Clozel
58d65d7a4c Refine auto-configurations conditions
Prior to this commit, auto-configurations were only checking for the
presence of GraphQL Java classes as guards, assuming that Spring
GraphQL classes were always on the classpath.

Auto-configurations are meant to be moved to the Spring Boot project in
the future, so this commit adds the relevant condition class checks to
reflect that spring-graphql might not be on the classpath.
2021-07-06 16:57:05 +02:00
Rossen Stoyanchev
69c2d08c71 Remove formatter-on/off comments 2021-07-06 15:51:50 +01:00
Rossen Stoyanchev
b594c19526 Add security package with basic infrastructure
Closes gh-80, gh-82
2021-07-06 15:38:16 +01:00
Rossen Stoyanchev
aea229778c Add README files to samples 2021-07-06 15:35:23 +01:00
Mark Paluch
08d49a848e Refine Querydsl integration documentation
Update repository example to implement Repository. Mention customizing and projection capabilities.

See gh-78
2021-07-06 08:55:31 +01:00
Rossen Stoyanchev
bac7461678 Add DataFetcherExceptionResolverAdapter
The adapter aims to:
- simplify the common case of synchronous resolution to a single error
- support ThreadLocal context propagation on an opt-in basis

This replaces the SyncDataFetcherExceptionResolver and removes the need
to propagate ThreadLocal context to every resolver.
2021-07-05 19:35:04 +01:00
Rossen Stoyanchev
a6211bda93 Minor ref doc updates 2021-07-05 16:04:50 +01:00
Rossen Stoyanchev
16656d623f Polishing Javadoc and in security sample 2021-07-05 14:36:25 +01:00
Rossen Stoyanchev
cc61c4baad Rename ContextManager to ReactorContextManager 2021-07-05 14:36:25 +01:00
Brian Clozel
212392d73f Move version configuration to Gradle properties 2021-07-05 15:10:08 +02:00
Rossen Stoyanchev
553dd3e571 Complete reference documentation
Closes gh-78
2021-07-05 12:26:54 +01:00
Rossen Stoyanchev
04d6a72eec Use RequestInput as the input for GraphQlService 2021-07-02 21:20:09 +01:00
Rossen Stoyanchev
5b444d0ef1 Fix link to source of reference docs 2021-07-02 20:29:32 +01:00
Rossen Stoyanchev
a70e525dc8 Fix formatting 2021-07-02 20:26:33 +01:00
Rossen Stoyanchev
10ebbe943c Add Web Transports section to reference docs
See gh-78
2021-07-02 20:26:33 +01:00
Brian Clozel
95a2af06a7 Fix missing header/footer in reference docs 2021-07-02 17:03:01 +02:00
Brian Clozel
d09f371048 Add missing configuration metadata for graphql metrics 2021-07-02 14:57:25 +02:00
Brian Clozel
2be79c2c73 Remove configuration key for GraphQL schema path
Currently, the GraphQL schema is exposed under /graphql/schema (so
relative to the main graphql endpoint) and is configurable with the
`spring.graphql.schema.printer.path` configuration property.

We think we should make the schema location more consistent to help
tools and various Gateway products. Also, we don't see right now a
strong use case for such a configuration property.

This commit removes the configuration property and sets the schema
location under `/graphql/schema`(`/graphql` being the main graphql path
configured by the application).

Closes gh-79
2021-07-02 13:57:36 +02:00
Rossen Stoyanchev
9a23e5f8d3 Restructure reference documentation
This commits sets the structure in place, moves the existing content
into its appropriate place, plus further updates to that content.

See gh-78
2021-07-02 12:47:12 +01:00
Rossen Stoyanchev
f17ae9307c Extract schema handling and move into main spring-graphql module 2021-07-02 10:25:18 +01:00
Rossen Stoyanchev
4740696ebf Move GraphiQl handlers to main spring-graphql module 2021-07-02 10:01:10 +01:00
Rossen Stoyanchev
9178075da5 Return 405 "Allow:POST" for HTTP GET queries
See gh-70
2021-07-01 15:48:55 +01:00
Brian Clozel
e3be107f96 Upgrade to Gradle 7.1 2021-07-01 09:50:20 +02:00
Brian Clozel
4333ab603a Fix links in READMEs 2021-07-01 09:48:24 +02:00
Brian Clozel
97a651e4ce Move Javadoc from "javadoc-api" to "api" folder 2021-07-01 09:18:32 +02:00
Brian Clozel
46f210b9d1 Polish documentation 2021-07-01 09:13:19 +02:00
Hantsy Bai
050480fcd6 fix links 2021-07-01 08:39:55 +02:00
Brian Clozel
ef0fe03fce Scan schema locations for well-known file extensions
This commit improves gh-56 to scan schema locations for more well-known
file extensions, as previously only `*.graphqls` was supported.
We're now scanning for `*.graphqls`, `*.gqls`, `*.graphql`, `*.gql`.

Closes gh-56
2021-06-30 21:06:17 +02:00
Brian Clozel
6e871a790b Rename docs artifact 2021-06-30 18:34:57 +02:00
Brian Clozel
34355051b5 Rename docs module
This commit renames the docs module to "spring-graphql-docs" to better
align with other Spring projects and their published docs artifact.
2021-06-30 18:16:27 +02:00
Brian Clozel
e8d8122d76 Remove duplicate reference documentation
Now that the reference documentation has been moved to its proper
toolchain, we can remove its former copy from the README file.

See gh-76
2021-06-30 17:59:45 +02:00
Brian Clozel
818396fce4 Add Spring Code Of Conduct 2021-06-30 17:59:45 +02:00
Brian Clozel
1727c7270a Set up reference documentation and JavaDoc
Closes gh-76
2021-06-30 17:59:45 +02:00
Stephane Nicoll
a1e8571853 Harmonize copyright header 2021-06-30 15:44:24 +02:00
Stephane Nicoll
9d4ebfe743 Polish 2021-06-30 15:44:24 +02:00
Stephane Nicoll
4a1ee14f88 Add default value for "spring.graphql.locations" 2021-06-30 15:44:24 +02:00
Brian Clozel
fdf446f3e6 Load multiple GraphQL schema files
Prior to this commit, the `spring.graphql.schema.location` would only
allow a single file as the source for the GraphQL schema.

This commit changes this configuration to
`spring.graphql.schema.locations` so that it accepts actual locations
(folders) and scans for `*.graphqls` files in those locations. All files
are parsed and merged as a single GraphQL `TypeDefinitionRegistry`.

Closes gh-56
2021-06-29 21:27:18 +02:00
Brian Clozel
f29c5ba764 Fix metadata in published artifacts 2021-06-29 16:39:43 +02:00
Brian Clozel
6dd5595f1e Add Milestone releases CI pipeline 2021-06-29 16:34:14 +02:00
Rossen Stoyanchev
bbf152a32f Deserialize errorType from extensions
The errorType field on GraphQLError is specific to GraphQL Java and when
serialized via GraphqlErrorHelper#toSpecification it becomes an
extension with the key "classification".

This commit ensures that we correctly deserialize back to errorType from
the "classification" extension but unfortunately that's limited to the
ErrorClassification enums that we know of.
2021-06-29 14:53:50 +01:00
Brian Clozel
71ce400e4f Upgrade CI pipeline and images 2021-06-29 15:40:51 +02:00
Rossen Stoyanchev
46221c6d17 Adjust mock expectations for QuerydslDataFetcher
See gh-71
2021-06-29 14:33:00 +01:00
Brian Clozel
eef61843d3 Add property for GraphiQL UI path
This commit adds a new `spring.graphql.graphiql.path` configuration
property for setting the path to the GraphiQL UI page.

This change requires updates in the static HTML page to link the
JavaScript fetcher back to the actual GraphQL API endpoint.

Closes gh-70
2021-06-29 13:52:08 +02:00
Rossen Stoyanchev
9a4da366aa Use fallback default predicate for QuerydslDataFetcher
Closes gh-71
2021-06-29 11:52:09 +01:00
Rob Winch
dfebb6f53d webmvc-http-security uses WebGraphQlTester
Issue gh-58
2021-06-28 15:40:45 -05:00
Rob Winch
7d854dbf47 Add webmvc-http-security
Closes gh-58
2021-06-28 14:17:16 -05:00