Skip to content

Commit

Permalink
Merge pull request #856 from t1/521-_entities
Browse files Browse the repository at this point in the history
#521: don't try to add the `_entities` query without an `_Entity` union
  • Loading branch information
phillip-kruger authored Jun 16, 2021
2 parents 5d125e7 + 6868dfb commit 69a736d
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,13 @@ private GraphQLObjectType toObjectType(ClassInfo typeInfo, GraphQLSchema graphQL
}

private void addQueries() {
// _entities(representations: [_Any!]!): [_Entity]!
this._entities = newFieldDefinition().name("_entities")
.argument(newArgument().name("representations").type(nonNull(list(nonNull(_Any)))))
.type(nonNull(list(_Entity))).build();
query.field(_entities);
if (_Entity != null) {
// _entities(representations: [_Any!]!): [_Entity]!
this._entities = newFieldDefinition().name("_entities")
.argument(newArgument().name("representations").type(nonNull(list(nonNull(_Any)))))
.type(nonNull(list(_Entity))).build();
query.field(_entities);
}

// _service: _Service!
this._Service_sdl = newFieldDefinition().name("sdl").type(nonNull(GraphQLString))
Expand Down

0 comments on commit 69a736d

Please sign in to comment.