Linking of top level schema not working if target field is a List Type

Issue #15 new
sarfaraz khan created an issue

I have two schema running on two different service. Let's say Friend and Recommendation. Which roughly looks like below

type Recommendation{
  ids:[int]!
}
type Query{
  recommendation(someParams):Recommendation
}

type Friend{
  ....
}
type Query{
  friends(ids[Int]):[Friend]
}

I'm stitching these two on a third service using Braid. So the ids from recommendation is passed to the second services.After schema stitching the resultant schema looks like this

recommendation(someParams):Recommendation

Recommendation - 
ids:[int]!
friends:Friend

where it should look like this

Recommendation - 
ids:[int]!
friends:[Friend]

After some debugging if found that the top level linking was not happening properly and hence at execution it was returning list of Friend .

I'm using the below config for stitching

namespace: "Recommendation"
complexLinks:
- sourceType: Recommendation
  field: friends
  targetNamespace: Friend
  targetType: Friend
  topLevelQueryField: friends
  arguments:
  - sourceName: ids
    argumentSource: OBJECT_FIELD
    queryArgumentName: ids
  - sourceName: XYZ
    argumentSource: FIELD_ARGUMENT
    queryArgumentName: XYZ

Comments (4)

  1. Log in to comment