Skip to content

Commit

Permalink
Merge pull request #187 from tasneemkoushar/master
Browse files Browse the repository at this point in the history
fix: made changes for service A, B, C, D, E
  • Loading branch information
ashpak-shaikh committed Oct 31, 2023
2 parents 73eee1e + 87a30ea commit 97493ff
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 183 deletions.
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.

0 comments on commit 97493ff

Please sign in to comment.