Skip to content

Commit

Permalink
feat: cleanup for major release (#8)
Browse files Browse the repository at this point in the history
- Update TODO comments
- Remove unused dependencies
- Update links in comments

We should have done a major release with the merge of #46, so — with
great shame — I’m retroactively adding it here.

BREAKING CHANGE: Update to the 1.x data source structure.
  • Loading branch information
jlengstorf committed Dec 19, 2017
1 parent b6b54d8 commit b87878f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
1 change: 0 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"presets": [
"stage-2",
[
"env",
{
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
},
Expand Down
1 change: 1 addition & 0 deletions src/context.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// TODO Add methods to access your data.
export default {
getById: id => ({
id,
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
}),
};
9 changes: 4 additions & 5 deletions src/resolvers.js
Original file line number Diff line number Diff line change
@@ -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,
},
Expand Down
7 changes: 5 additions & 2 deletions src/schema.graphql
Original file line number Diff line number Diff line change
@@ -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]
}

0 comments on commit b87878f

Please sign in to comment.