github Netflix/dgs-framework v4.9.17

latest releases: v9.1.3, v9.1.2, v9.1.1...
2 years ago

What’s Changed

Features

Support Apollo APQ (#829)

Summary

We now support Apollo's Automated Persisted Queries or APQ.
To enable this feature you will have to set the dgs.graphql.apq.enabled property to true.

Configuration
Property Name Type Default Description
dgs.graphql.apq.enabled boolean false Enables Apollo's APQ (as implemented in graphql-java) on the DGS Service
dgs.graphql.apq.default-cache.enabled boolean true Can be used to disable the default Caffeine Cache
dgs.graphql.apq.default-cache.caffeine-spec String maximumSize=100,expireAfterWrite=1h,recordStats Specifies the CaffeineSpec used by the default Caffeine Cache
Bean Overrides
  • You can implement your own Caffeine Cache Bean if you name it as apqCaffeineCache.
  • You can implement your own PersistedQueryCache, se below for details.
Details.

The PersistedQueryCache that backs the default implementation leverages a Caffeine Cache. You can provide your own PersistedQueryCache if the default doesn't suffice, please review the PersistedQueryCaffeineCache if you decide to do so. It is important that the cache can handle the case where the query text matches the value defined by the PersistedQuerySupport.PERSISTED_QUERY_MARKER property.

The Caffeine Cache used by the default PersistedQueryCaffeineCache is a named bean, apqCaffeineCache, that can be replaced. You can also specify the Caffeine Spec, encoded as a String value, via the dgs.graphql.apq.cache.caffeine-spec property. By default the dgs.graphql.apq.cache.caffeine-spec has maximumSize=100,expireAfterWrite=1h,recordStats but as mentioned you can define yours as needed.

Bug Fixes

  • Only use USER_DECLARED_METHODS when looking for DataFetchers (#845) @berngp
  • Issue-841: Fix NPE in equals method of TypedGraphQLError (#840) @rabbitvirus
  • We will now return a Bad Request Response if the Request Content is empty or malformed. (#835) @berngp

Others

Don't miss a new dgs-framework release

NewReleases is sending notifications on new releases.