-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Docs, Add Example, Fix Header Bug
fixes #2 Added `node-fetch` to polyfill the DOM Headers API. Changed server response to use `res.send()` instead of `res.json()` because it was causing the response to be sent as a string. Minor config changes to ignore files in testing/builds.
- Loading branch information
Showing
11 changed files
with
263 additions
and
11 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 |
---|---|---|
|
@@ -26,3 +26,5 @@ serverless.env.yml | |
|
||
coverage.lcov | ||
engine.json | ||
|
||
.vercel |
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,29 @@ | ||
import { ApolloServer } from "../pkg"; | ||
|
||
// Construct a schema, using GraphQL schema language | ||
const typeDefs = ` | ||
type Query { | ||
hello: String | ||
} | ||
`; | ||
|
||
// Provide resolver functions for your schema fields | ||
const resolvers = { | ||
Query: { | ||
hello: () => `Hello world!` | ||
} | ||
}; | ||
|
||
const server = new ApolloServer({ | ||
typeDefs, | ||
resolvers, | ||
// By default, the GraphQL Playground interface and GraphQL introspection | ||
// is disabled in "production" (i.e. when `process.env.NODE_ENV` is `production`). | ||
// | ||
// If you'd like to have GraphQL Playground and introspection enabled in production, | ||
// the `playground` and `introspection` options must be set explicitly to `true`. | ||
playground: true, | ||
introspection: true | ||
}); | ||
|
||
export default server.createHandler(); |
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,6 @@ | ||
{ | ||
"infiniteLoopProtection": true, | ||
"hardReloadOnChange": false, | ||
"view": "browser", | ||
"template": "node" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "apollo-server-vercel", | ||
"version": 2, | ||
"scope": "saeris", | ||
"functions": { | ||
"api/example.ts": { | ||
"maxDuration": 5 | ||
} | ||
} | ||
} |
Oops, something went wrong.
e2b779e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: