-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
68 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[graphql-http](../README.md) / use/@netlify/functions | ||
|
||
# Module: use/@netlify/functions | ||
|
||
## Table of contents | ||
|
||
### Type Aliases | ||
|
||
- [HandlerOptions](use__netlify_functions.md#handleroptions) | ||
|
||
### Functions | ||
|
||
- [createHandler](use__netlify_functions.md#createhandler) | ||
|
||
## Server/netlify | ||
|
||
### HandlerOptions | ||
|
||
Ƭ **HandlerOptions**<`Context`\>: [`HandlerOptions`](../interfaces/handler.HandlerOptions.md)<`HandlerEvent`, `HandlerContext`, `Context`\> | ||
|
||
Handler options when using the netlify adapter | ||
|
||
#### Type parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `Context` | extends [`OperationContext`](handler.md#operationcontext) = `undefined` | | ||
|
||
___ | ||
|
||
### createHandler | ||
|
||
▸ **createHandler**<`Context`\>(`options`): `Handler` | ||
|
||
Create a GraphQL over HTTP spec compliant request handler for netlify functions | ||
|
||
#### Type parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `Context` | extends [`OperationContext`](handler.md#operationcontext) = `undefined` | | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `options` | [`HandlerOptions`](use__netlify_functions.md#handleroptions)<`Context`\> | | ||
|
||
#### Returns | ||
|
||
`Handler` |
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,7 @@ | ||
import { GraphQLSchema } from 'graphql'; | ||
import { createHandler } from 'graphql-http/lib/use/@netlify/functions'; // npm install @netlify/functions | ||
|
||
const schema = new GraphQLSchema() | ||
|
||
// Create the GraphQL over HTTP native fetch handler | ||
export const handler = createHandler({ schema }); |
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