Skip to content

Commit e2b13ad

Browse files
Ryan O. MackeyGitHub Enterprise
authored andcommitted
Merge pull request #1 from Bluemix/feat/gramps
feat(GrAMPS): update to use GrAMPS
2 parents b6dba80 + 11b2538 commit e2b13ad

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

package.TEMPLATE.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "@console/graphql-data-source-[DATA_SOURCE_NAME]",
33
"description": "This is a data source for the Bluemix GraphQL µ-service.",
4-
"author": "Your Name <[email protected]>",
4+
"contributors": [
5+
"Your Name <[email protected]>"
6+
],
57
"repository": {
68
"type": "git",
79
"url": "[email protected]:bluemix/[REPO_NAME].git"
810
},
9-
"version": "0.0.0-semantic-release",
10-
"main": "src/index.js",
11+
"main": "dist/index.js",
1112
"directories": {
1213
"test": "test"
1314
},
@@ -24,16 +25,18 @@
2425
"atlas": "npm run proxy & npm run dev -- --atlas --config ./config/app_env_private.json",
2526
"lint": "eslint src/*.js",
2627
"test:unit": "NODE_ENV=test LOG4JS_LEVEL='OFF' jest --coverage",
27-
"test": "npm run lint --silent && npm run test:unit --silent"
28+
"test": "npm run lint --silent && npm run test:unit --silent",
29+
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
2830
},
2931
"keywords": [
3032
"graphql"
3133
],
3234
"license": "ISC",
3335
"dependencies": {
34-
"@console/graphql-data-source-helpers": "^1.0.2",
36+
"@console/gramps": "0.0.2",
3537
"casual": "^1.5.14",
36-
"graphql-tools": "^1.2.1"
38+
"graphql-tools": "^1.2.1",
39+
"log4js": "^1.1.0"
3740
},
3841
"devDependencies": {
3942
"@console/graphql": "^1.2.0",
@@ -45,6 +48,7 @@
4548
"babel-preset-env": "^1.6.0",
4649
"babel-preset-es2015": "^6.24.1",
4750
"babel-preset-stage-2": "^6.24.1",
51+
"condition-travis-enterprise": "^1.0.0",
4852
"del-cli": "^1.1.0",
4953
"eslint": "^4.4.1",
5054
"eslint-config-airbnb-base": "^11.3.1",
@@ -89,5 +93,6 @@
8993
"githubUrl": "https://github.ibm.com/",
9094
"githubApiPathPrefix": "api/v3",
9195
"verifyConditions": "condition-travis-enterprise"
92-
}
96+
},
97+
"version": "0.0.0-semantic-release"
9398
}

src/connector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GraphQLConnector } from '@console/graphql-data-source-helpers';
1+
import { GraphQLConnector } from '@console/gramps';
22

33
// TODO: change `YourDataSourceConnector` to a descriptive name
44
export default class YourDataSourceConnector extends GraphQLConnector {

src/model.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import {
2-
GraphQLModel,
3-
BluemixGraphQLError,
4-
} from '@console/graphql-data-source-helpers';
1+
import { GraphQLModel, GrampsError } from '@console/gramps';
52

63
/*
74
* For more information on data source models, see
@@ -22,16 +19,16 @@ export default class YourDataSourceModel extends GraphQLModel {
2219
}
2320

2421
/**
25-
* Throws a BluemixGraphQLError using information from the error response.
22+
* Throws a GrampsError using information from the error response.
2623
*
2724
* @see https://ibm.biz/graphql-helpers
2825
*
2926
* @param {object} response an error response
3027
* @return {void}
3128
*/
3229
handleError(response) {
33-
// TODO: map your endpoint’s error response to the BluemixGraphQL
34-
throw BluemixGraphQLError({
30+
// TODO: map your endpoint’s error response to the GrampsError format.
31+
throw GrampsError({
3532
// An HTTP status code (e.g. 404).
3633
statusCode: response.statusCode,
3734
// A human-readable description of what went wrong (e.g. "Page not found").

test/connector-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GraphQLConnector } from '@console/graphql-data-source-helpers';
1+
import { GraphQLConnector } from '@console/gramps';
22
import Connector from '../src/connector';
33

44
// TODO: Update the data source name.

test/model-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GraphQLModel } from '@console/graphql-data-source-helpers';
1+
import { GraphQLModel } from '@console/gramps';
22
import Model from '../src/model';
33
import Connector from '../src/connector';
44

0 commit comments

Comments
 (0)