public void IsSubscriptionType_False() { // arrange DocumentNode schema = Parser.Default.Parse( "type Subscription { a: String } type Abc { a: String }"); var schemaInfo = new SchemaInfo("foo", schema); ObjectTypeDefinitionNode queryType = schema.Definitions .OfType <ObjectTypeDefinitionNode>().Last(); var type = new ObjectTypeInfo(queryType, schemaInfo); // act bool isQuery = type.IsSubscriptionType(); // assert Assert.False(isQuery); }
public void IsQueryType_True() { // arrange DocumentNode schema = Utf8GraphQLParser.Parse( "type Query { a: String } type Abc { a: String }"); var schemaInfo = new SchemaInfo("foo", schema); ObjectTypeDefinitionNode queryType = schema.Definitions .OfType <ObjectTypeDefinitionNode>().First(); var type = new ObjectTypeInfo(queryType, schemaInfo); // act bool isQuery = type.IsQueryType(); // assert Assert.True(isQuery); }