-
I've read over the https://www.graphql-mesh.com/docs/getting-started/combine-multiple-sources and https://www.graphql-mesh.com/docs/guides/extending-unified-schema probably 20 times now, and no matter what I try, I don't seem to be able to combine my data sources and I'm not sure why. I'm almost definitely overlooking something stupid, but really hoping some one here can tell me what it is. I'll try to give as simplified of a case as I could find with just 2 sources. If I were to write a query to get the data from each one individually it would look like this: query {
crm {
companies {
id
}
}
loki {
companySettingsReportEmail(companyId: 1) {
reportEmail
}
}
} What I would like to be able to do is this: query {
crm {
companies {
reportEmail
}
}
} and grab the I have tried +10 different types of variations of this in my .meshrc.yml file: additionalResolvers:
- targetTypeName: Company
targetFieldName: reportEmail
sourceName: loki
sourceTypeName: Query
sourceFieldName: companySettingsReportEmail
requiredSelectionSet: |
{
id
}
sourceArgs:
companyId: "{root.id}" But no matter what I try I get an error like this:
I was "strangely" able to get 1 step further (possibly?) with this one:
I don't know why this would or should do anything, since loki is not supposed to be a fieldName? and from here I have no idea how I would specify But anyway, when using "loki" as the sourceFieldName it throws this error instead:
I tried changing the Can anyone please help explain how to use additionalResolvers to combine real data sources? I did add this typeDefs which I think is the only correct thing I've done: extend type Company {
reportEmail: String
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
See if this will help you: https://github.com/sesmi123/graphqlmesh-disc-3912 |
Beta Was this translation helpful? Give feedback.
See if this will help you: https://github.com/sesmi123/graphqlmesh-disc-3912