Skip to content

Commit b87878f

Browse files
authored
feat: cleanup for major release (#8)
- 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.
1 parent b6b54d8 commit b87878f

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

.babelrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"presets": [
3-
"stage-2",
43
[
54
"env",
65
{

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"babel-jest": "^21.2.0",
4646
"babel-plugin-inline-import": "^2.0.6",
4747
"babel-preset-env": "^1.6.1",
48-
"babel-preset-stage-2": "^6.24.1",
4948
"cross-env": "^5.1.1",
5049
"del-cli": "^1.1.0",
5150
"eslint": "^4.13.1",
@@ -57,7 +56,6 @@
5756
"graphql-tools": "^2.13.0",
5857
"husky": "^0.14.3",
5958
"jest": "^21.2.1",
60-
"nodemon": "^1.13.3",
6159
"prettier": "^1.9.2",
6260
"semantic-release": "^8.2.0"
6361
},

src/context.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO Add methods to access your data.
12
export default {
23
getById: id => ({
34
id,

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import resolvers from './resolvers';
44
import mocks from './mocks';
55

66
/*
7-
* For more information on the main data source object, see
8-
* https://ibm.biz/graphql-data-source-main
7+
* For more information on the building GrAMPS data sources, see
8+
* https://gramps.js.org/data-source/data-source-overview/
99
*/
1010
export default {
1111
// TODO: Rename the context to describe the data source.

src/mocks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { MockList } from 'graphql-tools';
22
import casual from 'casual';
33

44
export default {
5-
// TODO: Update to mock all schema fields and types.
5+
// TODO: Update to mock all schema types and fields
66
PFX_DataSourceBase: () => ({
77
id: casual.uuid,
88
name: casual.name,
9-
lucky_numbers: () => new MockList([0, 3]), // casual.array_of_digits(3),
9+
lucky_numbers: () => new MockList([0, 3]),
1010
}),
1111
};

src/resolvers.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
export default {
22
Query: {
3-
// TODO: Update query resolver name(s) to match schema queries
4-
getById: (_, { id }, context) =>
5-
// TODO: Update to use the model and call the proper method.
6-
context.getById(id),
3+
// TODO: Update query resolver name and args to match the schema
4+
// TODO: Update the context method to load the correct data
5+
getById: (_, { id }, context) => context.getById(id),
76
},
8-
// TODO: Update to reference the schema type(s) and field(s).
7+
// TODO: Update to map data to your schema type(s) and field(s)
98
PFX_DataSourceBase: {
109
name: data => data.name || null,
1110
},

src/schema.graphql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
type Query {
22
# TODO: rename and add a description of this query
33
getById(
4-
# TODO: Describe this argument
4+
# A unique identifier
55
id: ID!
66
): PFX_DataSourceBase
77
}
88

99
# TODO: Choose a unique prefix and rename the type descriptively.
1010
type PFX_DataSourceBase {
11-
# The unique ID of the thing.
11+
# A unique identifier
1212
id: ID!
1313
# Describe each field to help people use the data more effectively.
1414
name: String
15+
# An array of very super lucky numbers.
16+
#
17+
# DISCLAIMER: The luckiness of these numbers is _not scientifically proven_.
1518
lucky_numbers: [Int]
1619
}

0 commit comments

Comments
 (0)