Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #11 from pancho111203/master
Browse files Browse the repository at this point in the history
Bug Fixes
  • Loading branch information
djhi authored Feb 21, 2017
2 parents 8d40638 + 9d73bd0 commit 630d4c7
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 163 deletions.
10 changes: 9 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"es2015",
"stage-0"
],

"plugins": [
[
"transform-runtime",
{
"polyfill": false,
"regenerator": true
}
]
],
"env": {
"test": {
"plugins": [
Expand Down
49 changes: 25 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,33 @@
},
"devDependencies": {
"admin-on-rest": "~0.8.1",
"babel-cli": "6.22.2",
"babel-core": "6.22.1",
"babel-plugin-istanbul": "4.0.0",
"babel-preset-es2015": "6.22.0",
"babel-preset-stage-0": "6.22.0",
"eslint": "3.15.0",
"eslint-config-airbnb-base": "11.1.0",
"eslint-plugin-import": "2.2.0",
"expect": "1.20.2",
"istanbul-cobertura-badger": "1.2.1",
"mocha": "3.2.0",
"nyc": "10.1.2"
"babel-cli": "~6.22.2",
"babel-core": "~6.22.1",
"babel-plugin-istanbul": "~4.0.0",
"babel-preset-es2015": "~6.22.0",
"babel-preset-stage-0": "~6.22.0",
"eslint": "~3.15.0",
"eslint-config-airbnb-base": "~11.1.0",
"eslint-plugin-import": "~2.2.0",
"expect": "~1.20.2",
"istanbul-cobertura-badger": "~1.2.1",
"mocha": "~3.2.0",
"nyc": "~10.1.2"
},
"dependencies": {
"apollo-client": "0.8.5",
"graphql": "0.9.1",
"graphql-tag": "1.2.4",
"isomorphic-fetch": "2.2.1",
"lodash.merge": "4.6.0",
"lodash.omit": "4.5.0",
"lodash.pick": "4.4.0",
"lodash.pickby": "4.6.0",
"pluralize": "3.1.0",
"react-router": "3.0.2",
"react-router-redux": "4.0.8",
"redux-saga": "0.14.3"
"apollo-client": "~0.8.7",
"babel-plugin-transform-runtime": "~6.23.0",
"graphql": "~0.9.1",
"graphql-tag": "~1.2.4",
"isomorphic-fetch": "~2.2.1",
"lodash.merge": "~4.6.0",
"lodash.omit": "~4.5.0",
"lodash.pick": "~4.4.0",
"lodash.pickby": "~4.6.0",
"pluralize": "~3.1.0",
"react-router": "~3.0.2",
"react-router-redux": "~4.0.8",
"redux-saga": "~0.14.3"
},
"peerDependencies": {
"admin-on-rest": "~0.8.1"
Expand Down
2 changes: 1 addition & 1 deletion src/parseApolloResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
*/
const getApolloResultKey = (type, apolloParams) => (
QUERY_TYPES.includes(type)
? apolloParams.query.definitions[0].name.value
? apolloParams.query.definitions[0].selectionSet.selections[0].name.value
: apolloParams.mutation.definitions[0].selectionSet.selections[0].name.value
);

Expand Down
43 changes: 36 additions & 7 deletions src/parseApolloResponse.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ describe('parseApolloResponse', () => {
},
},
};

const apolloParams = {
query: {
definitions: [{ name: { value: 'operationName' } }],
definitions: [{
selectionSet: {
selections: [{ name: { value: 'operationName' } }],
},
}],
},
};

Expand All @@ -45,7 +50,11 @@ describe('parseApolloResponse', () => {
};
const apolloParams = {
query: {
definitions: [{ name: { value: 'operationName' } }],
definitions: [{
selectionSet: {
selections: [{ name: { value: 'operationName' } }],
},
}],
},
};

Expand All @@ -63,7 +72,11 @@ describe('parseApolloResponse', () => {
};
const apolloParams = {
query: {
definitions: [{ name: { value: 'operationName' } }],
definitions: [{
selectionSet: {
selections: [{ name: { value: 'operationName' } }],
},
}],
},
};

Expand All @@ -83,7 +96,11 @@ describe('parseApolloResponse', () => {
};
const apolloParams = {
query: {
definitions: [{ name: { value: 'operationName' } }],
definitions: [{
selectionSet: {
selections: [{ name: { value: 'operationName' } }],
},
}],
},
};

Expand All @@ -105,7 +122,11 @@ describe('parseApolloResponse', () => {
};
const apolloParams = {
query: {
definitions: [{ name: { value: 'operationName' } }],
definitions: [{
selectionSet: {
selections: [{ name: { value: 'operationName' } }],
},
}],
},
};

Expand All @@ -123,7 +144,11 @@ describe('parseApolloResponse', () => {
};
const apolloParams = {
query: {
definitions: [{ name: { value: 'operationName' } }],
definitions: [{
selectionSet: {
selections: [{ name: { value: 'operationName' } }],
},
}],
},
};

Expand All @@ -145,7 +170,11 @@ describe('parseApolloResponse', () => {
};
const apolloParams = {
query: {
definitions: [{ name: { value: 'operationName' } }],
definitions: [{
selectionSet: {
selections: [{ name: { value: 'operationName' } }],
},
}],
},
};

Expand Down
Loading

0 comments on commit 630d4c7

Please sign in to comment.