You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working with shared types, I was able to get multiple services to fill the same type when it's in the root query, but could not get this to work when the object is in an inner query.
For example assume I have a "tasks" service and a "profiles" service, and each task can have an "owner" field which is a Profile.
Given the following schema for tasks:
directive @boundary on OBJECT | FIELD_DEFINITION
type Query {
tasks(done: Boolean): [Task]
task(id: String): Task
service: Service!
tasks__profile(id: ID!): Profile @boundary
}
type Profile @boundary {
id: ID!
}
type Task {
_id: String
text: String
done: Boolean
owner: Profile
}
type Service {
name: String! # unique name for the service
version: String! # any string
schema: String! # the full schema for the service
}
And this schema for a Profile service:
directive @boundary on OBJECT | FIELD_DEFINITION
type Query {
service: Service!
profile(id: ID!): Profile @boundary
someone: Profile
}
type Profile @boundary {
id: ID!
first_name: String
last_name: String
}
type Service {
name: String! # unique name for the service
version: String! # any string
schema: String! # the full schema for the service
}
I have no problem using the someone query to get a profile and fill its fields from both services, but when I try to read the tasks and data about their owners such as:
query {
tasks {
text
owner {
id
first_name
}
}
}
I will get just "null" as the result data.
If I remove first_name field from the query everything will work and I will get the correct id of the owner, so I assume tasks service works ok.
Is there a way to get bramble gateway to fill inner owner query from a different service?
The text was updated successfully, but these errors were encountered:
Hi Bramble,
Working with shared types, I was able to get multiple services to fill the same type when it's in the root query, but could not get this to work when the object is in an inner query.
For example assume I have a "tasks" service and a "profiles" service, and each task can have an "owner" field which is a Profile.
Given the following schema for tasks:
And this schema for a Profile service:
I have no problem using the
someone
query to get a profile and fill its fields from both services, but when I try to read the tasks and data about their owners such as:I will get just "null" as the result data.
If I remove
first_name
field from the query everything will work and I will get the correct id of the owner, so I assume tasks service works ok.Is there a way to get bramble gateway to fill inner
owner
query from a different service?The text was updated successfully, but these errors were encountered: