dgs-framework

GraphQL for Java with Spring Boot made easy.

APACHE-2.0 License

Stars
3.1K

Bot releases are visible (Hide)

dgs-framework - v8.5.5

Published by github-actions[bot] 7 months ago

What’s Changed

  • optional-context-propagation (#1878) @paulbakker
dgs-framework - v8.5.4

Published by github-actions[bot] 7 months ago

What’s Changed

  • Update multipart-spring-graphql dependency (#1877) @paulbakker
  • Expose errorType in TypedGraphQLError (#1867) @kilink
  • Use micrometer context propagation for virtual thread executor (#1875) @paulbakker
  • Disable problematic autoconfigs from spring-graphql by default (#1874) @paulbakker
  • Fix missing response in DgsContext (#1870) @paulbakker
dgs-framework - v8.5.3

Published by github-actions[bot] 7 months ago

What’s Changed

  • Rework DgsDataLoaderRegistry to avoid some overhead (#1842) @kilink
  • Bump actions/cache from 4.0.1 to 4.0.2 (#1855) @dependabot
  • Update to Spring Boot 3.2.4 (#1851) @kilink
  • Switch to using measureTimedValue (#1843) @kilink
  • Remove deprecated fields from TypedGraphQLError (#1824) @kilink
dgs-framework - v8.5.2

Published by github-actions[bot] 7 months ago

What’s Changed

  • Fix bug in Spring query executors (#1864) @kilink
dgs-framework - v8.5.0

Published by github-actions[bot] 7 months ago

The DGS and Spring GraphQL teams are super excited to introduce deep integration between the DGS framework and Spring GraphQL. This will bring the community together, and we can continue building the best possible GraphQL framework for Spring Boot in the future.

Special thanks to @kilink for being our first early adopter and contributing many bug fixes and performance improvements as part of this effort, and to @rstoyanchev and @bclozel from the Spring GraphQL team for partnering with us closely on integration between the frameworks.

Getting Started with DGS/Spring GraphQL

You can opt-in to use DGS/Spring GraphQL by replacing the starter dependency.

Replace implementation "com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter" with implementation "com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter".
You also need to add either Spring WebMVC or Spring WebFlux explicitly.

With this integration, it is technically possible to mix and match the DGS/Spring GraphQL programming models. However, to maintain consistency in your codebase and to take full advantage of DGS features, we recommend sticking with the DGS programming model. Additional features from Spring GraphQL will be available via existing Spring GraphQL extensions, such as multipart-spring-graphql and the https://github.com/apollographql/federation-jvm/pull/354 in the JVM Federation library.

Background - Two competing frameworks

The DGS Framework provides Java developers with a programming model on top of Spring Boot to create GraphQL services. Netflix open-sourced the DGS framework in 2021, and has been the widely adopted GraphQL Java framework by many companies.

Soon after we open-sourced the DGS framework, we learned about parallel efforts by the Spring team to develop a GraphQL framework for Spring Boot. The Spring GraphQL project was in the early stages at the time and provided a low-level of integration with graphql-java. Over the past year, however, Spring GraphQL has matured and is mostly at feature parity with the DGS Framework. We now have 2 competing frameworks that solve the same problems for our users.

Today, new users must choose between the DGS Framework or Spring GraphQL, thus missing out on features available in one framework but not the other. This is not an ideal situation for the GraphQL Java community.

For the maintainers of DGS and Spring GraphQL, it would be far more effective to collaborate on features and improvements instead of having to solve the same problem independently. Finally, a unified community would provide us with better channels for feedback.

Technical implementation

The details of the implementation are discussed in detail in the documentation.

Required Changes

The good news is that the new integration has been mostly a drop-in replacement, not requiring any major code changes for the user.

Async Dispatch

By default, Spring GraphQL uses async dispatch for handling HTTP GraphQL Requests when using WebMVC.
In this DGS Framework we have turned off this behavior by default to preserve existing functionality, since it requires existing code to be async aware. This implies servlet filters, tests etc. need to be also async aware.
You can turn on async behavior by setting the dgs.graphql.spring.webmvc.asyncdispatch.enabled to true.

It is worth noting that with the Spring GraphQL integration, your MockMVC test set up does need to be updated.
Since web request processing is now based on async dispatching mechanism, we now require explicit handling for this in the test setup.

File Uploads

Support for file uploads will no longer be available by default in the DGS framework.
This is supported using an external dependency for Spring GraphQL via multipart-spring-graphql.

Schema Inspection

You can now inspect your schema using Spring GraphQL's [schema inspection] (https://docs.spring.io/spring-graphql/reference/request-execution.html#execution.graphqlsource.schema-mapping-inspection) feature for DGS data fetchers as well.
You can now inspect schema fields and validate existing DGS data fetcher/and or Spring GraphQL data fetcher registrations, to check if all schema fields are covered either by an explicitly registered DataFetcher, or a matching Java object property.
The inspection also performs a reverse check looking for DataFetcher registrations against schema fields that don't exist.

Performance

At Netflix, we tested the DGS/Spring GraphQL integration on some of our largest services. We have worked hard to make performance of the new integration on-par with the existing implementation. Performance (CPU, memory, latency) is now the same or better on all the services we have tested.

Known Gaps

At this time, we are lacking support for SSE based subscriptions. This is on the roadmap and will be made available depending on support in Spring GraphQL.

Configuration

There is some overlap between configuration properties for DGS and Spring GraphQL. Where properties overlap, we use the DGS property for the best backward compatibility. The following list is the overlapping properties.

DGS property Spring GraphQL property What to use
dgs.graphql.schema-locations spring.graphql.schema.locations Use dgs.graphql.schema-locations
N/A spring.graphql.schema.fileExtensions Not applicable, because dgs.graphql.schema-locations includes the path
dgs.graphql.graphiql.enabled spring.graphql.graphiql.enabled Use dgs.graphql.graphiql.enabled
dgs.graphql.graphiql.path spring.graphql.graphiql.path Use dgs.graphql.graphiql.path
dgs.graphql.websocket.connection-init-timeout spring.graphql.websocket.connection-init-timeout DGS property sets the Spring GraphQL property

New properties for Spring GraphQl integration are:

DGS Property Description
dgs.graphql.spring.webmvc.asyncdispatch.enabled To enable async dispatching for GraphQL requests
dgs-framework - v5.6.2

Published by srinivasankavitha 7 months ago

What's Changed

  • Picks up latest graphql-java 21.5 with vulnerability fixes.
dgs-framework - v8.4.4

Published by github-actions[bot] 7 months ago

What’s Changed

  • Update graphql-java to 21.5 (#1861) @spellew
dgs-framework - v8.4.3

Published by github-actions[bot] 7 months ago

What’s Changed

  • Add logging for exceptions when encountering internal server error. (#1858) @srinivasankavitha
  • Bump actions/checkout from 4.1.1 to 4.1.2 (#1847) @dependabot
dgs-framework - v8.4.2

Published by github-actions[bot] 7 months ago

What’s Changed

  • Update graphql-java to 21.4 (#1850) @kailyak
dgs-framework - v8.5.0-rc.3

Published by paulbakker 7 months ago

dgs-framework - v8.4.1

Published by github-actions[bot] 7 months ago

What’s Changed

  • Bump actions/cache from 4.0.0 to 4.0.1 (#1828) @dependabot
  • Bump org.apache.logging.log4j:log4j-to-slf4j from 2.23.0 to 2.23.1 (#1838) @dependabot
  • Bump org.apache.logging.log4j:log4j-api from 2.23.0 to 2.23.1 (#1837) @dependabot
  • Optimize conversion in DefaultInputObjectMapper (#1835) @kilink
  • Update to Kotlin 1.9.23 (#1840) @kilink
  • Update to Spring Boot 3.2.3 (#1834) @kilink
dgs-framework - v8.5.0-rc.2

Published by srinivasankavitha 7 months ago

Candidate for spring-graphql integration.

dgs-framework - v8.5.0-rc.1

Published by srinivasankavitha 8 months ago

Candidate for spring-graphql.

dgs-framework - v8.4.0

Published by Emily 8 months ago

What's Changed

Full Changelog: https://github.com/Netflix/dgs-framework/compare/v8.3.1...v8.4.0

dgs-framework - New Dataloader Hooks Candidate

Published by Emily 8 months ago

What's Changed

dgs-framework -

Published by github-actions[bot] 8 months ago

What’s Changed

  • Increment error metric (#1816) @spellew
  • Avoid overhead in loading DataLoaderInstrumentationExtensionProviders (#1814) @kilink
dgs-framework - v8.3.0

Published by github-actions[bot] 9 months ago

What’s Changed

This release updates the framework to use a new major version of the federation library: federation-graphql-java-support to 4.4.0(https://github.com/apollographql/federation-jvm/releases/tag/v4.4.0) from the previous 3.0.0.
There are changes to how the federated-tracing context is set up since deprecated API support for this is now dropped in the library. Besides this change, this release should be backwards compatible for DGS users. Please refer to their release notes for more details.

  • Update to latest federation-graphql-java-support lib 4.4.0. (#1813) @srinivasankavitha
  • Make all timer threads daemonic in subscription handlers (#1811) @kilink
  • Remove kotlinx-coroutines-jdk8 dependency (#1807) @kilink
  • fix: cancel timer thread after websocket connection init task runs (#1808) @mikefischetti
dgs-framework - v8.2.6-rc.3

Published by paulbakker 9 months ago

Candidate release to test spring-graphql integration - NOT Production ready.

  • Wire up PreparsedDocuementProvider if available
dgs-framework - v8.2.6-rc.2

Published by paulbakker 9 months ago

Candidate release to test spring-graphql integration - NOT Production ready.

  • Added @ConditionalOnClass(ServerRequest::class) on DgsReactiveQueryExecutor bean.
dgs-framework - v8.2.6-rc.1

Published by paulbakker 9 months ago

Candidate release to test spring-graphql integration - NOT Production ready.

  • Added @ConditionalOnClass(ServerRequest::class) on DgsReactiveQueryExecutor bean.