Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Proyect-GraphQL-React
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sonia Vidal Gonzalez
Proyect-GraphQL-React
Commits
825a1766
Commit
825a1766
authored
May 29, 2019
by
alexlbr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds books mock
parent
e50effbd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
index.js
src/index.js
+14
-0
No files found.
src/index.js
View file @
825a1766
const
fetch
=
require
(
"node-fetch"
);
const
fetch
=
require
(
"node-fetch"
);
const
{
ApolloServer
,
gql
}
=
require
(
"apollo-server"
);
const
{
ApolloServer
,
gql
}
=
require
(
"apollo-server"
);
// This is a (sample) collection of books we'll be able to query
// the GraphQL server for. A more complete example might fetch
// from an existing data source like a REST API or database.
const
books
=
[
{
title
:
"Harry Potter and the Chamber of Secrets"
,
author
:
"J.K. Rowling"
},
{
title
:
"Jurassic Park"
,
author
:
"Michael Crichton"
}
];
// Type definitions define the "shape" of your data and specify
// Type definitions define the "shape" of your data and specify
// which ways the data can be fetched from the GraphQL server.
// which ways the data can be fetched from the GraphQL server.
const
typeDefs
=
gql
`
const
typeDefs
=
gql
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment