-
Notifications
You must be signed in to change notification settings - Fork 114
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
9 changed files
with
51 additions
and
16 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
4 changes: 2 additions & 2 deletions
4
.../introduction/implement-your-providers.md → docs/introduction/implement-providers.md
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
4 changes: 2 additions & 2 deletions
4
.../introduction/implement-your-resolvers.md → docs/introduction/implement-resolvers.md
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,36 @@ | ||
--- | ||
id: implement-server | ||
title: Implement Your Server | ||
sidebar_label: Implement Server | ||
--- | ||
|
||
To get started, add `express` amd `express-graphql` to your app: | ||
|
||
```bash | ||
yarn add express express-graphql | ||
``` | ||
|
||
Then, | ||
|
||
```typescript | ||
import { GraphQLModule, buildAppContext } from '@graphql-modules/core'; | ||
import * as express from 'express'; | ||
import * as graphqlHTTP from 'express-graphql'; | ||
|
||
const { schema } = new GraphQLModule({ | ||
/*...*/ | ||
}); | ||
|
||
const app = express(); | ||
|
||
app.use('/graphql', graphqlHTTP({ | ||
schema, | ||
graphiql: true | ||
}); | ||
|
||
app.listen(4000); | ||
``` | ||
> To test your server, run `ts-node index.ts` and try to open `http://localhost:4000/`, you should see the **[GraphiQL](https://github.com/graphql/graphiql)** UI. | ||
|
||
> If you want to use **[Apollo-Server](https://www.apollographql.com/docs/apollo-server/getting-started.html)** check **Integrate with Apollo Server** section |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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