Skip to content

Commit 88b86cd

Browse files
saihajardatan
andauthored
docs: handleAsSDL option (#9193)
* docs: handleAsSDL option * Update website/src/pages/docs/config-reference/schema-field.mdx Co-authored-by: Arda TANRIKULU <[email protected]> --------- Co-authored-by: Arda TANRIKULU <[email protected]>
1 parent 9635ddf commit 88b86cd

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

website/src/pages/docs/config-reference/schema-field.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,26 @@ export default config;
162162

163163
```
164164

165+
##### `handleAsSDL`
166+
167+
Handling the response as SDL will allow you to load schema from remote server that doesn't return a JSON introspection. Example use case is when using schema registry like [GraphQL Hive](https://docs.graphql-hive.com/features/high-availability-cdn#graphql-schema-sdl).
168+
169+
```ts {7}
170+
import { CodegenConfig } from '@graphql-codegen/cli';
171+
172+
const config: CodegenConfig = {
173+
schema: [
174+
{
175+
'http://localhost:3000/sdl': {
176+
handleAsSDL: true,
177+
}
178+
}
179+
]
180+
};
181+
export default config;
182+
183+
```
184+
165185
### JSON
166186

167187
You can point to a local `.json` file that contains [GraphQL Introspection](https://graphql.org/learn/introspection) JSON.

0 commit comments

Comments
 (0)