From 83d2a2e4599dc5d7c8d6742c9182a2a762c8a391 Mon Sep 17 00:00:00 2001 From: Pedro Mantica Date: Mon, 4 Mar 2019 11:34:10 -0500 Subject: [PATCH] Nits --- graphql_compiler/tests/test_helpers.py | 332 ++++++++++++------------- 1 file changed, 166 insertions(+), 166 deletions(-) diff --git a/graphql_compiler/tests/test_helpers.py b/graphql_compiler/tests/test_helpers.py index 6e104ef76..53fcd32e0 100644 --- a/graphql_compiler/tests/test_helpers.py +++ b/graphql_compiler/tests/test_helpers.py @@ -93,172 +93,172 @@ def get_schema(): # Instead, it aims to capture as many real-world edge cases as possible, # without requiring a massive number of types and interfaces. schema_text = ''' - schema { - query: RootSchemaQuery - } - - directive @filter(op_name: String!, value: [String!]!) on FIELD | INLINE_FRAGMENT - - directive @tag(tag_name: String!) on FIELD - - directive @output(out_name: String!) on FIELD - - directive @output_source on FIELD - - directive @optional on FIELD - - directive @recurse(depth: Int!) on FIELD - - directive @fold on FIELD - - type Animal implements Entity, UniquelyIdentifiable { - _x_count: Int - alias: [String] - birthday: Date - color: String - description: String - in_Animal_ParentOf: [Animal] - in_Entity_Related: [Entity] - name: String - net_worth: Decimal - out_Animal_BornAt: [BirthEvent] - out_Animal_FedAt: [FeedingEvent] - out_Animal_ImportantEvent: [Union__BirthEvent__Event__FeedingEvent] - out_Animal_LivesIn: [Location] - out_Animal_OfSpecies: [Species] - out_Animal_ParentOf: [Animal] - out_Entity_Related: [Entity] - uuid: ID - } - - type BirthEvent implements Entity, UniquelyIdentifiable { - _x_count: Int - alias: [String] - description: String - event_date: DateTime - in_Animal_BornAt: [Animal] - in_Animal_ImportantEvent: [Animal] - in_Entity_Related: [Entity] - in_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] - name: String - out_Entity_Related: [Entity] - out_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] - uuid: ID - } - - scalar Date - - scalar DateTime - - scalar Decimal - - interface Entity { - _x_count: Int - alias: [String] - description: String - in_Entity_Related: [Entity] - name: String - out_Entity_Related: [Entity] - uuid: ID - } - - type Event implements Entity, UniquelyIdentifiable { - _x_count: Int - alias: [String] - description: String - event_date: DateTime - in_Animal_ImportantEvent: [Animal] - in_Entity_Related: [Entity] - in_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] - name: String - out_Entity_Related: [Entity] - out_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] - uuid: ID - } - - type FeedingEvent implements Entity, UniquelyIdentifiable { - _x_count: Int - alias: [String] - description: String - event_date: DateTime - in_Animal_FedAt: [Animal] - in_Animal_ImportantEvent: [Animal] - in_Entity_Related: [Entity] - in_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] - name: String - out_Entity_Related: [Entity] - out_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] - uuid: ID - } - - type Food implements Entity, UniquelyIdentifiable { - _x_count: Int - alias: [String] - description: String - in_Entity_Related: [Entity] - in_Species_Eats: [Species] - name: String - out_Entity_Related: [Entity] - uuid: ID - } - - type FoodOrSpecies implements Entity, UniquelyIdentifiable { - _x_count: Int - alias: [String] - description: String - in_Entity_Related: [Entity] - in_Species_Eats: [Species] - name: String - out_Entity_Related: [Entity] - uuid: ID - } - - type Location implements Entity, UniquelyIdentifiable { - _x_count: Int - alias: [String] - description: String - in_Animal_LivesIn: [Animal] - in_Entity_Related: [Entity] - name: String - out_Entity_Related: [Entity] - uuid: ID - } - - type RootSchemaQuery { - 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 { - _x_count: Int - alias: [String] - description: String - in_Animal_OfSpecies: [Animal] - in_Entity_Related: [Entity] - in_Species_Eats: [Species] - limbs: Int - name: String - out_Entity_Related: [Entity] - out_Species_Eats: [Union__Food__FoodOrSpecies__Species] - uuid: ID - } - - union Union__BirthEvent__Event__FeedingEvent = BirthEvent | Event | FeedingEvent - - union Union__Food__FoodOrSpecies__Species = Food | FoodOrSpecies | Species - - interface UniquelyIdentifiable { - _x_count: Int - uuid: ID - } + schema { + query: RootSchemaQuery + } + + directive @filter(op_name: String!, value: [String!]!) on FIELD | INLINE_FRAGMENT + + directive @tag(tag_name: String!) on FIELD + + directive @output(out_name: String!) on FIELD + + directive @output_source on FIELD + + directive @optional on FIELD + + directive @recurse(depth: Int!) on FIELD + + directive @fold on FIELD + + type Animal implements Entity, UniquelyIdentifiable { + _x_count: Int + alias: [String] + birthday: Date + color: String + description: String + in_Animal_ParentOf: [Animal] + in_Entity_Related: [Entity] + name: String + net_worth: Decimal + out_Animal_BornAt: [BirthEvent] + out_Animal_FedAt: [FeedingEvent] + out_Animal_ImportantEvent: [Union__BirthEvent__Event__FeedingEvent] + out_Animal_LivesIn: [Location] + out_Animal_OfSpecies: [Species] + out_Animal_ParentOf: [Animal] + out_Entity_Related: [Entity] + uuid: ID + } + + type BirthEvent implements Entity, UniquelyIdentifiable { + _x_count: Int + alias: [String] + description: String + event_date: DateTime + in_Animal_BornAt: [Animal] + in_Animal_ImportantEvent: [Animal] + in_Entity_Related: [Entity] + in_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] + name: String + out_Entity_Related: [Entity] + out_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] + uuid: ID + } + + scalar Date + + scalar DateTime + + scalar Decimal + + interface Entity { + _x_count: Int + alias: [String] + description: String + in_Entity_Related: [Entity] + name: String + out_Entity_Related: [Entity] + uuid: ID + } + + type Event implements Entity, UniquelyIdentifiable { + _x_count: Int + alias: [String] + description: String + event_date: DateTime + in_Animal_ImportantEvent: [Animal] + in_Entity_Related: [Entity] + in_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] + name: String + out_Entity_Related: [Entity] + out_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] + uuid: ID + } + + type FeedingEvent implements Entity, UniquelyIdentifiable { + _x_count: Int + alias: [String] + description: String + event_date: DateTime + in_Animal_FedAt: [Animal] + in_Animal_ImportantEvent: [Animal] + in_Entity_Related: [Entity] + in_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] + name: String + out_Entity_Related: [Entity] + out_Event_RelatedEvent: [Union__BirthEvent__Event__FeedingEvent] + uuid: ID + } + + type Food implements Entity, UniquelyIdentifiable { + _x_count: Int + alias: [String] + description: String + in_Entity_Related: [Entity] + in_Species_Eats: [Species] + name: String + out_Entity_Related: [Entity] + uuid: ID + } + + type FoodOrSpecies implements Entity, UniquelyIdentifiable { + _x_count: Int + alias: [String] + description: String + in_Entity_Related: [Entity] + in_Species_Eats: [Species] + name: String + out_Entity_Related: [Entity] + uuid: ID + } + + type Location implements Entity, UniquelyIdentifiable { + _x_count: Int + alias: [String] + description: String + in_Animal_LivesIn: [Animal] + in_Entity_Related: [Entity] + name: String + out_Entity_Related: [Entity] + uuid: ID + } + + type RootSchemaQuery { + 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 { + _x_count: Int + alias: [String] + description: String + in_Animal_OfSpecies: [Animal] + in_Entity_Related: [Entity] + in_Species_Eats: [Species] + limbs: Int + name: String + out_Entity_Related: [Entity] + out_Species_Eats: [Union__Food__FoodOrSpecies__Species] + uuid: ID + } + + union Union__BirthEvent__Event__FeedingEvent = BirthEvent | Event | FeedingEvent + + union Union__Food__FoodOrSpecies__Species = Food | FoodOrSpecies | Species + + interface UniquelyIdentifiable { + _x_count: Int + uuid: ID + } ''' ast = parse(schema_text)