Skip to content

Commit 6d3017b

Browse files
committed
Fix flow type errors
Update flow-bin till 0.29 Fix peerDependencies Update `graphql-compose` till 0.0.7
1 parent 3d68299 commit 6d3017b

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ esproposal.class_instance_fields=enable
1313
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
1414

1515
[version]
16-
0.28.0
16+
0.29.0

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ This is a plugin for [graphql-compose](https://github.com/nodkz/graphql-compose)
44

55
[CHANGELOG](https://github.com/nodkz/graphql-compose-relay/blob/master/CHANGELOG.md)
66

7+
Installation
8+
============
9+
```
10+
npm install graphql graphql-compose graphql-compose-relay --save
11+
```
12+
Modules `graphql` and `graphql-compose` are in `peerDependencies`, so should be installed explicitly in your app. They have global objects and should not have ability to be installed as submodule.
13+
714
Example
815
=======
916
`TypeComposer` is a [graphql-compose](https://github.com/nodkz/graphql-compose) utility, that wraps GraphQL types and provide bunch of useful methods for type manipulation.

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222
"url": "https://github.com/nodkz/graphql-compose-relay/issues"
2323
},
2424
"homepage": "https://github.com/nodkz/graphql-compose-relay",
25-
"dependencies": {
26-
"graphql-compose": ">=0.0.6"
27-
},
2825
"peerDependencies": {
29-
"graphql": "^0.5.0"
26+
"graphql": ">=0.5.0 || >=0.6.0",
27+
"graphql-compose": ">=0.0.7 || >=1.0.0"
3028
},
3129
"devDependencies": {
3230
"babel-cli": "6.10.1",
@@ -47,7 +45,7 @@
4745
"eslint-plugin-import": "1.10.2",
4846
"eslint-plugin-jsx-a11y": "1.5.5",
4947
"eslint-plugin-react": "5.2.2",
50-
"flow-bin": "0.28.0",
48+
"flow-bin": "0.29.0",
5149
"mocha": "2.5.3",
5250
"rimraf": "2.5.2",
5351
"sane": "1.3.4"

src/globalId.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function unbase64(i: Base64String): string {
1717
* Takes a type name and an ID specific to that type name, and returns a
1818
* "global ID" that is unique among all types.
1919
*/
20-
export function toGlobalId(type: string, id: string): string {
20+
export function toGlobalId(type: string, id: string | number): string {
2121
return base64([type, id].join(':'));
2222
}
2323

src/nodeFieldConfig.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
import { fromGlobalId } from './globalId';
99
import NodeInterface from './nodeInterface';
1010
import type { TypeFindByIdMap } from './definition.js';
11+
import { getProjectionFromAST } from 'graphql-compose';
1112

1213
// this fieldConfig must be set to RootQuery.node field
1314
export function getNodeFieldConfig(typeToFindByIdMap: TypeFindByIdMap) {
@@ -35,6 +36,7 @@ export function getNodeFieldConfig(typeToFindByIdMap: TypeFindByIdMap) {
3536
args: { [idArgName]: id }, // eg. mongoose has _id fieldname, so should map
3637
context,
3738
info,
39+
projection: getProjectionFromAST(info),
3840
}).then(res => {
3941
if (res) {
4042
res.__nodeType = findById.getTypeComposer().getType();

0 commit comments

Comments
 (0)