Skip to content

fix: made changes for service A, B, C, D, E #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
package com.intuit.graphql.orchestrator.integration

import com.intuit.graphql.orchestrator.GraphQLOrchestrator
import com.intuit.graphql.orchestrator.ServiceD
import com.intuit.graphql.orchestrator.ServiceE
import com.intuit.graphql.orchestrator.ServiceProvider
import com.intuit.graphql.orchestrator.schema.transform.FieldMergeException
import helpers.BaseIntegrationTestSpecification

class MutationNestedFieldsArgumentsSpec extends BaseIntegrationTestSpecification {
def mockDServiceResponse = [
data: [
serviceD: []
]
]

def mockEServiceResponse = [
data: [
serviceD: []
]
]

def "cannot Build Due To Mutation Nested Fields Has Mismatched Arguments"() {
def serviceD = createSimpleMockService( "SVCD", "type Query { } "
+ "type Mutation { container(in : String) : Container } "
+ "type Container { serviceD : ServiceD } "
+ "type ServiceD { svcDField1 : String }", mockDServiceResponse)

def serviceE = createSimpleMockService( "SVCE", "type Query { } "
+ "type Mutation { container(out : String) : Container } "
+ "type Container { serviceE : ServiceE } "
+ "type ServiceE { svcEField1 : String }", mockEServiceResponse)


given:
ServiceProvider[] services = [ new ServiceD(), new ServiceE() ]
ServiceProvider[] services = [ serviceD, serviceE ]

when:
GraphQLOrchestrator orchestrator = createGraphQLOrchestrator(services)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
package com.intuit.graphql.orchestrator.integration

import com.intuit.graphql.orchestrator.GraphQLOrchestrator
import com.intuit.graphql.orchestrator.ServiceA
import com.intuit.graphql.orchestrator.ServiceB
import com.intuit.graphql.orchestrator.ServiceProvider
import com.intuit.graphql.orchestrator.schema.transform.FieldMergeException
import helpers.BaseIntegrationTestSpecification

class NestedFieldsArgumentsSpec extends BaseIntegrationTestSpecification {
def mockAServiceResponse = [
data: [
serviceA: []
]
]

def mockBServiceResponse = [
data: [
serviceB: []
]
]

def "cannot Build Due To Query Nested Fields Has Mismatched Arguments"() {
def serviceA = createSimpleMockService( "SVCA", "type Query { container : Container } "
+ "type Container { serviceA : ServiceA } "
+ "type ServiceA { svcAField1 : String }", mockAServiceResponse)

def serviceB = createSimpleMockService( "SVCB", "type Query { container(in : String) : Container } "
+ "type Container { serviceB : ServiceB } "
+ "type ServiceB { svcBField1 : String }", mockBServiceResponse)


when:
ServiceProvider[] services = [ new ServiceA(), new ServiceB() ]
ServiceProvider[] services = [ serviceA, serviceB ]
GraphQLOrchestrator orchestrator = createGraphQLOrchestrator(services)

then:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
package com.intuit.graphql.orchestrator.integration

import com.intuit.graphql.orchestrator.GraphQLOrchestrator
import com.intuit.graphql.orchestrator.ServiceA
import com.intuit.graphql.orchestrator.ServiceC
import com.intuit.graphql.orchestrator.ServiceProvider
import com.intuit.graphql.orchestrator.schema.transform.FieldMergeException
import helpers.BaseIntegrationTestSpecification

class NestedFieldsDirectivesSpec extends BaseIntegrationTestSpecification {

def mockAServiceResponse = [
data: [
serviceA: []
]
]

def mockCServiceResponse = [
data: [
serviceC: []
]
]


def "cannot Build Due To Query Nested Fields Has Mismatched Directives"() {
def serviceA = createSimpleMockService( "SVCA", "type Query { container : Container } "
+ "type Container { serviceA : ServiceA } "
+ "type ServiceA { svcAField1 : String }", mockAServiceResponse)

def serviceC = createSimpleMockService( "SVCC", "type Query { container : Container @deprecated } "
+ "type Container { serviceC : ServiceC } "
+ "type ServiceC { svcCField1 : String }", mockCServiceResponse)


when:
ServiceProvider[] services = [new ServiceA(), new ServiceC() ]
ServiceProvider[] services = [serviceA, serviceC]
GraphQLOrchestrator orchestrator = createGraphQLOrchestrator(services)

then:
Expand Down
34 changes: 0 additions & 34 deletions src/test/java/com/intuit/graphql/orchestrator/ServiceA.java

This file was deleted.

34 changes: 0 additions & 34 deletions src/test/java/com/intuit/graphql/orchestrator/ServiceB.java

This file was deleted.

35 changes: 0 additions & 35 deletions src/test/java/com/intuit/graphql/orchestrator/ServiceC.java

This file was deleted.

35 changes: 0 additions & 35 deletions src/test/java/com/intuit/graphql/orchestrator/ServiceD.java

This file was deleted.

36 changes: 0 additions & 36 deletions src/test/java/com/intuit/graphql/orchestrator/ServiceE.java

This file was deleted.