Skip to content

Commit

Permalink
Upgrade to GraphQL 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
steveluscher committed May 5, 2016
1 parent 1941fcb commit fe9fa91
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 121 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"eslint-plugin-react": "^5.0.1",
"fbjs-scripts": "^0.7.0",
"flow-bin": "0.24.1",
"graphql": "0.4.13",
"graphql": "0.5.0",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-derequire": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/babel-relay-plugin/lib/HASH
Original file line number Diff line number Diff line change
@@ -1 +1 @@
poYhnSoUhrpmb95d1rq1EP9B9BE=
gPEyhVvztpBecZiMXer9Doo+wGw=
4 changes: 2 additions & 2 deletions scripts/babel-relay-plugin/lib/RelayQLAST.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ var RelayQLType = function () {
} else if (types.isAbstractType(type) && fieldAST && fieldAST.directives && fieldAST.directives.some(function (directive) {
return directive.name.value === 'fixme_fat_interface';
})) {
var possibleTypes = type.getPossibleTypes();
var possibleTypes = this.context.schema.getPossibleTypes();

var _loop = function _loop(ii) {
var possibleField = possibleTypes[ii].getFields()[fieldName];
Expand Down Expand Up @@ -589,7 +589,7 @@ var RelayQLType = function () {
var _this16 = this;

invariant(this.isAbstract(), 'Cannot get concrete types of a concrete type.');
return this.schemaUnmodifiedType.getPossibleTypes().map(function (concreteType) {
return this.context.schema.getPossibleTypes().map(function (concreteType) {
return new RelayQLType(_this16.context, concreteType);
});
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/babel-relay-plugin/lib/tools/generateSchemaJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ try {

var body = fs.readFileSync(inFile, 'utf8');
var ast = language.parse(body);
var astSchema = utilities.buildASTSchema(ast, 'Root', 'Mutation', 'Subscription');
var astSchema = utilities.buildASTSchema(ast);
graphql.graphql(astSchema, utilities.introspectionQuery).then(function (result) {
var out = JSON.stringify(result, null, 2);
fs.writeFileSync(outFile, out);
Expand All @@ -40,4 +40,4 @@ try {
} catch (error) {
console.error(error);
console.error(error.stack);
}
}
2 changes: 1 addition & 1 deletion scripts/babel-relay-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"rimraf": "^2.5.2"
},
"dependencies": {
"graphql": "^0.4.18"
"graphql": "^0.5.0"
},
"jest": {
"persistModuleRegistryBetweenSpecs": true,
Expand Down
4 changes: 2 additions & 2 deletions scripts/babel-relay-plugin/src/RelayQLAST.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class RelayQLType {
directive => directive.name.value === 'fixme_fat_interface'
)
) {
const possibleTypes = type.getPossibleTypes();
const possibleTypes = this.context.schema.getPossibleTypes();
for (let ii = 0; ii < possibleTypes.length; ii++) {
const possibleField = possibleTypes[ii].getFields()[fieldName];
if (possibleField) {
Expand Down Expand Up @@ -541,7 +541,7 @@ class RelayQLType {
this.isAbstract(),
'Cannot get concrete types of a concrete type.'
);
return this.schemaUnmodifiedType.getPossibleTypes().map(
return this.context.schema.getPossibleTypes().map(
concreteType => new RelayQLType(this.context, concreteType)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,9 @@ enum Gender {
}

union Media = Story | ProfilePicture

schema {
query: Root
mutation: Mutation
subscription: Subscription
}
Loading

0 comments on commit fe9fa91

Please sign in to comment.