Skip to content

Commit

Permalink
Use list types in schema generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bojan Serafimov committed May 20, 2019
1 parent 2c30ca3 commit 4974f79
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion graphql_compiler/schema_generation/graphql_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def get_graphql_schema_from_schema_graph(schema_graph, class_to_field_type_overr
# Create the root query GraphQL type. Consists of all non-union classes, i.e.
# all non-abstract classes (as GraphQL types) and all abstract classes (as GraphQL interfaces).
RootSchemaQuery = GraphQLObjectType('RootSchemaQuery', OrderedDict([
(name, GraphQLField(value))
(name, GraphQLField(GraphQLList(value)))
for name, value in sorted(six.iteritems(graphql_types), key=lambda x: x[0])
if not isinstance(value, GraphQLUnionType)
]))
Expand Down
20 changes: 10 additions & 10 deletions graphql_compiler/tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,16 @@
}
type RootSchemaQuery {
Animal: Animal
BirthEvent: BirthEvent
Entity: Entity
Event: Event
FeedingEvent: FeedingEvent
Food: Food
FoodOrSpecies: FoodOrSpecies
Location: Location
Species: Species
UniquelyIdentifiable: UniquelyIdentifiable
Animal: [Animal]
BirthEvent: [BirthEvent]
Entity: [Entity]
Event: [Event]
FeedingEvent: [FeedingEvent]
Food: [Food]
FoodOrSpecies: [FoodOrSpecies]
Location: [Location]
Species: [Species]
UniquelyIdentifiable: [UniquelyIdentifiable]
}
type Species implements Entity, UniquelyIdentifiable {
Expand Down

0 comments on commit 4974f79

Please sign in to comment.