diff --git a/.babelrc b/.babelrc index 2953f83..f11de23 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,5 @@ { "presets": [ - "stage-2", [ "env", { diff --git a/package.json b/package.json index 2a340ca..5132362 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "babel-jest": "^21.2.0", "babel-plugin-inline-import": "^2.0.6", "babel-preset-env": "^1.6.1", - "babel-preset-stage-2": "^6.24.1", "cross-env": "^5.1.1", "del-cli": "^1.1.0", "eslint": "^4.13.1", @@ -57,7 +56,6 @@ "graphql-tools": "^2.13.0", "husky": "^0.14.3", "jest": "^21.2.1", - "nodemon": "^1.13.3", "prettier": "^1.9.2", "semantic-release": "^8.2.0" }, diff --git a/src/context.js b/src/context.js index 504eb33..cf6093b 100644 --- a/src/context.js +++ b/src/context.js @@ -1,3 +1,4 @@ +// TODO Add methods to access your data. export default { getById: id => ({ id, diff --git a/src/index.js b/src/index.js index 475cbc9..1ab11e3 100644 --- a/src/index.js +++ b/src/index.js @@ -4,8 +4,8 @@ import resolvers from './resolvers'; import mocks from './mocks'; /* - * For more information on the main data source object, see - * https://ibm.biz/graphql-data-source-main + * For more information on the building GrAMPS data sources, see + * https://gramps.js.org/data-source/data-source-overview/ */ export default { // TODO: Rename the context to describe the data source. diff --git a/src/mocks.js b/src/mocks.js index c792fad..66c3e8c 100644 --- a/src/mocks.js +++ b/src/mocks.js @@ -2,10 +2,10 @@ import { MockList } from 'graphql-tools'; import casual from 'casual'; export default { - // TODO: Update to mock all schema fields and types. + // TODO: Update to mock all schema types and fields PFX_DataSourceBase: () => ({ id: casual.uuid, name: casual.name, - lucky_numbers: () => new MockList([0, 3]), // casual.array_of_digits(3), + lucky_numbers: () => new MockList([0, 3]), }), }; diff --git a/src/resolvers.js b/src/resolvers.js index cc79cbd..c49f50e 100644 --- a/src/resolvers.js +++ b/src/resolvers.js @@ -1,11 +1,10 @@ export default { Query: { - // TODO: Update query resolver name(s) to match schema queries - getById: (_, { id }, context) => - // TODO: Update to use the model and call the proper method. - context.getById(id), + // TODO: Update query resolver name and args to match the schema + // TODO: Update the context method to load the correct data + getById: (_, { id }, context) => context.getById(id), }, - // TODO: Update to reference the schema type(s) and field(s). + // TODO: Update to map data to your schema type(s) and field(s) PFX_DataSourceBase: { name: data => data.name || null, }, diff --git a/src/schema.graphql b/src/schema.graphql index 5a2c6c6..a4fb5fb 100644 --- a/src/schema.graphql +++ b/src/schema.graphql @@ -1,16 +1,19 @@ type Query { # TODO: rename and add a description of this query getById( - # TODO: Describe this argument + # A unique identifier id: ID! ): PFX_DataSourceBase } # TODO: Choose a unique prefix and rename the type descriptively. type PFX_DataSourceBase { - # The unique ID of the thing. + # A unique identifier id: ID! # Describe each field to help people use the data more effectively. name: String + # An array of very super lucky numbers. + # + # DISCLAIMER: The luckiness of these numbers is _not scientifically proven_. lucky_numbers: [Int] }