B2B Integration 10.5 | Administering and Monitoring B2B Transactions | Service Development Help | Working with GraphQL Descriptors | Creating a GraphQL Descriptor | How Integration Server Generates Output Signature for Resolver Services
 
How Integration Server Generates Output Signature for Resolver Services
For example, consider the following schema:
Schema:
type Query {
getLink(id: ID): Link
}

type Link {
id: ID
postedBy: User
}

interface User {
id: ID
name: String
}

type ExternalUser implements User{
id: ID
name: String
dept(id: ID): String
}

type InternalUser implements User {
id: ID
name: String
address: Address
}

type HomeAddress {
hAddr: String
}

type OfficeAddress {
oAddr: String
}

union Address = HomeAddress | OfficeAddress
When you import the above schema, then Integration Server generates these resolver services:
In the above schema,
1. The field dept under ExternalUser type is of type String (which is Scalar) so the output signature for deptResolver contains a field dept of type String.
2. The field getLink under root operation Query is of type Object, so the output signature for the getLinkResolver service contains a field getLink referring to the document type Link.
3. The field postedBy under the type User is of type Interface, so the output signature for the postedByResolver service contains a field postedBy referring to the document type User, and a field $outputObjectType of type String. The pick list for field $outputObjectType contains list of objects that implement the User interface. In this case, the pick list contains ExternalUser and InternalUser. During runtime if the resolver service is returning data corresponding to InternalUser, then you need to select InternalUser for field $outputObjectType, and if the resolver service is returning data corresponding to ExternalUser, then you need to select ExternalUser for field $outputObjectType.
If you do not select any value for field $outputObjectType, then Integration Server throws a runtime error.
4. The Field address under type InternalUser is of type Union, so the output signature for the addressResolver service contains a field address referring to the document type Address, and a field $outputObjectType of type String. The pick list for field $outputObjectType contains list of all the member objects for the Union. In this case, the pick list contains HomeAddress and OfficeAddress. During runtime if the resolver service is returning data corresponding to HomeAddress, then you need to select HomeAddress for field $outputObjectType, and if the resolver service is returning data corresponding to OfficeAddress, then you need to select OfficeAddress for field $outputObjectType.
If you do not select any value for field $outputObjectType, then Integration Server throws a runtime error.

Copyright © 2016- 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.