branch: elpa/graphql-mode
commit 880701685d34fd779398d057d3f67e7ec8569ead
Author: David Vazquez Pua <[email protected]>
Commit: David Vazquez Pua <[email protected]>
Add some types/field to the test schema
---
test/index.js | 11 ++++++++++-
test/schema.graphql | 7 ++++++-
test/simple-query.graphql | 7 ++++++-
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/test/index.js b/test/index.js
index c5adfc28ff..f33df4b7f8 100644
--- a/test/index.js
+++ b/test/index.js
@@ -9,7 +9,16 @@ var fs = require('fs');
var schemaContent = fs.readFileSync(__dirname + '/schema.graphql', 'utf-8');
var schema = buildSchema(schemaContent);
-var root = { hello: () => 'Hello world!' };
+var root = {
+ person: (obj, args) => ({
+ name: "David",
+ friends: ()=>[
+ {
+ name: "Ana"
+ }
+ ]
+ })
+};
var app = express();
app.use('/graphql', graphqlHTTP({
diff --git a/test/schema.graphql b/test/schema.graphql
index 6ae991f681..85d77c0566 100644
--- a/test/schema.graphql
+++ b/test/schema.graphql
@@ -1,3 +1,8 @@
type Query {
- hello: String
+ person(id: ID): Person
+}
+
+type Person {
+ name: String
+ friends: [Person]
}
diff --git a/test/simple-query.graphql b/test/simple-query.graphql
index eb8f4922ab..081d38e6c0 100644
--- a/test/simple-query.graphql
+++ b/test/simple-query.graphql
@@ -1,3 +1,8 @@
{
- hello
+ person(id:1){
+ name
+ friends {
+ name
+ }
+ }
}