-
Notifications
You must be signed in to change notification settings - Fork 3
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
8 changed files
with
60 additions
and
69 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
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
|
||
|
||
const { logoData } = require('./data/sampleLogoData'); | ||
const { logoData } = require("./data/sampleLogoData"); | ||
|
||
const SampleLogoResolver = { | ||
Query: { | ||
logo: logoData, | ||
} | ||
} | ||
Query: { | ||
logo: logoData, | ||
}, | ||
}; | ||
|
||
module.exports = SampleLogoResolver | ||
module.exports = SampleLogoResolver; |
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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
|
||
const { personsData } = require('./data/samplePeopleData'); | ||
const { personsData } = require("./data/samplePeopleData"); | ||
|
||
const SamplePersonResolver = { | ||
Query: { | ||
persons: personsData, | ||
} | ||
} | ||
Query: { | ||
persons: personsData, | ||
}, | ||
}; | ||
|
||
module.exports = SamplePersonResolver | ||
module.exports = SamplePersonResolver; |
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
const personsData = () => { | ||
return [{id: 'id_1', firstname: 'John BAM', surname: 'Senior', age: 70}, {id: 'id_2', firstname: 'Jennifer BAM', surname: 'Middleage', age: 42}, {id: 'id_3', firstname: 'Sam BAM', surname: 'Young', age: 12}]; | ||
} | ||
return [ | ||
{ id: "id_1", firstname: "John BAM", surname: "Senior", age: 70 }, | ||
{ id: "id_2", firstname: "Jennifer BAM", surname: "Middleage", age: 42 }, | ||
{ id: "id_3", firstname: "Sam BAM", surname: "Young", age: 12 }, | ||
]; | ||
}; | ||
|
||
module.exports = { personsData }; | ||
module.exports = { personsData }; |
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 |
---|---|---|
@@ -1,16 +1,14 @@ | ||
|
||
const SamplePersonResolvers = require('./SamplePersonResolvers'); | ||
const SampleLogoResolvers = require('./SampleLogoResolvers'); | ||
const SamplePersonResolvers = require("./SamplePersonResolvers"); | ||
const SampleLogoResolvers = require("./SampleLogoResolvers"); | ||
|
||
const Resolvers = [ | ||
// Sample resolvers here | ||
SamplePersonResolvers, | ||
SamplePersonResolvers, | ||
SampleLogoResolvers, | ||
// add your custom resolvers here and put the data | ||
// into the JSON data into the 'data' folder. | ||
|
||
]; | ||
|
||
module.exports = { | ||
Resolvers | ||
} | ||
Resolvers, | ||
}; |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
const gql = require('graphql-tag'); | ||
const gql = require("graphql-tag"); | ||
|
||
const LogoTypeDef = gql` | ||
extend type Query { | ||
logo(logoId: String!): Logo, | ||
} | ||
extend type Query { | ||
logo(logoId: String!): Logo | ||
} | ||
type Logo { | ||
logoId: String | ||
name: String | ||
} | ||
type Logo { | ||
logoId: String | ||
name: String | ||
} | ||
`; | ||
|
||
module.exports = LogoTypeDef | ||
module.exports = LogoTypeDef; |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
const gql = require('graphql-tag'); | ||
const gql = require("graphql-tag"); | ||
|
||
const PersonTypeDef = gql` | ||
type Query { | ||
persons: [Person], | ||
} | ||
type Query { | ||
persons: [Person] | ||
} | ||
type Person { | ||
id: String | ||
firstname: String | ||
surname: String | ||
age: Int | ||
} | ||
type Person { | ||
id: String | ||
firstname: String | ||
surname: String | ||
age: Int | ||
} | ||
`; | ||
|
||
module.exports = PersonTypeDef | ||
module.exports = PersonTypeDef; |
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 |
---|---|---|
@@ -1,15 +1,13 @@ | ||
|
||
const PersonTypeDef = require('./PersonTypeDef'); | ||
const LogoTypeDef = require('./LogoTypeDef'); | ||
const PersonTypeDef = require("./PersonTypeDef"); | ||
const LogoTypeDef = require("./LogoTypeDef"); | ||
|
||
const TypeDefs = [ | ||
// Sample tyepDefs here | ||
PersonTypeDef, | ||
LogoTypeDef | ||
// add custom ones here | ||
|
||
]; | ||
|
||
module.exports = { | ||
TypeDefs | ||
} | ||
// Sample tyepDefs here | ||
PersonTypeDef, | ||
LogoTypeDef, | ||
// add custom ones here | ||
]; | ||
|
||
module.exports = { | ||
TypeDefs, | ||
}; |