-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Hive's experimental persisted documents (#7530)
* types * persisted docs in hive plugin * changeset * impl and use * changeset * omit persisteddocs from hiverportingoptions * disable usage reporting if just persisted documents are configured * support truthy debug env vars * ok eslint go away * chore(dependencies): updated changesets for modified dependencies * chore(dependencies): updated changesets for modified dependencies * Add allowArbitraryDocuments option * Add persisted documents plugin * Documentation * Fix links --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
- Loading branch information
1 parent
13fa835
commit db41f96
Showing
18 changed files
with
384 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
'@graphql-mesh/serve-cli': minor | ||
--- | ||
|
||
Support Hive's experimental persisted documents | ||
|
||
### Using CLI options | ||
|
||
```sh | ||
mesh-serve supergraph [schemaPathOrUrl] --hive-persisted-documents-endpoint "https://cdn.graphql-hive.com/<target_id>" --hive-persisted-documents-token <cdn_access_token> | ||
``` | ||
|
||
### Using config file | ||
|
||
```ts | ||
import { defineConfig } from '@graphql-mesh/serve-cli' | ||
|
||
export const serveConfig = defineConfig({ | ||
persistedDocuments: { | ||
type: 'hive', | ||
endpoint: 'https://cdn.graphql-hive.com/<target_id>', | ||
token: '<cdn_access_token>' | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@graphql-mesh/plugin-hive': patch | ||
--- | ||
|
||
Support truthy DEBUG environment variables (1, t, true, y, yes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
'@graphql-mesh/types': minor | ||
'@graphql-mesh/plugin-hive': minor | ||
--- | ||
|
||
Support Hive's experimental persisted documents | ||
|
||
```ts | ||
import { useMeshHive } from '@graphql-mesh/plugin-hive' | ||
|
||
// Usage Reporting | ||
useMeshHive({ | ||
token: '<hive_registry_token>' | ||
}) | ||
|
||
// Persisted Documents | ||
useMeshHive({ | ||
experimental__persistedDocuments: { | ||
cdn: { | ||
endpoint: 'https://cdn.graphql-hive.com/<target_id>', | ||
accessToken: '<cdn_access_token>' | ||
} | ||
} | ||
}) | ||
|
||
// Usage Reporting and Persisted Documents | ||
useMeshHive({ | ||
token: '<hive_registry_token>', | ||
experimental__persistedDocuments: { | ||
cdn: { | ||
endpoint: 'https://cdn.graphql-hive.com/<target_id>', | ||
accessToken: '<cdn_access_token>' | ||
} | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
'@graphql-mesh/serve-runtime': minor | ||
--- | ||
|
||
Support Hive's experimental persisted documents | ||
|
||
```ts | ||
import { createServeRuntime } from '@graphql-mesh/serve-runtime' | ||
|
||
createServeRuntime({ | ||
persistedDocuments: { | ||
type: 'hive', | ||
endpoint: 'https://cdn.graphql-hive.com/<target_id>', | ||
token: '<cdn_access_token>' | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.