You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: web-app/stories/Level.stories.tsx
+133
Original file line number
Diff line number
Diff line change
@@ -134,3 +134,136 @@ storiesOf('Level', module)
134
134
/>
135
135
)
136
136
})
137
+
.add('FakeBook API L1',()=>{
138
+
constlevel={
139
+
id: 'L1',
140
+
title: 'Server Setup',
141
+
description: 'Configure a GraphQL server using Apollo Server.',
142
+
content:
143
+
'Apollo Server is a popular and easy to configure GraphQL server.\n[Apollo Server](https://www.apollographql.com/docs/apollo-server/ee7fbac9c0ca5b1dd6aef886bb695e63/index-diagram.svg)\nBy the end of this lesson you should have your own working server started.',
144
+
setup: {
145
+
commits: ['6adeb95'],
146
+
commands: ['npm install'],
147
+
},
148
+
steps: [
149
+
{
150
+
id: 'L1:S1',
151
+
content:
152
+
'Start by installing the apollo server dependencies. In a terminal, run:\n ```shell\nnpm install --save apollo-server graphql\n```',
'Setup your Apollo Server in `src/main.ts`. Notice that the GraphQL requires two elements: `typeDefs` & `resolvers` - more on these later.\nConfigure the server in the following way:\n```ts\nexport const server = new ApolloServer({\n typeDefs,\n resolvers,\n})\n```',
168
+
setup: {
169
+
files: ['src/main.ts'],
170
+
commits: ['13d8c60'],
171
+
},
172
+
solution: {
173
+
files: ['src/main.ts'],
174
+
commits: ['3dd3500'],
175
+
},
176
+
},
177
+
{
178
+
id: 'L1:S3',
179
+
content:
180
+
'Internally, Apollo is really running an [Express](https://expressjs.com/) server.\nTo start the server call `listen`.\n ```shell\nserver.listen(4000)\n```',
181
+
setup: {
182
+
files: ['src/main.ts'],
183
+
commits: ['1d55cc5'],
184
+
},
185
+
solution: {
186
+
files: ['src/main.ts'],
187
+
commits: ['c92311f'],
188
+
},
189
+
},
190
+
{
191
+
id: 'L1:S4',
192
+
content:
193
+
'GraphQL playground is a UI for viewing your schema & docs and testing queries.\nThe playground can be easily configured, just specify `playground: true` in the config.\n```js\nApolloServer({\n /*...*/\n playground: true,\n})\n```\nVisit http://localhost:4000/graphql to see the playground in action.',
0 commit comments