Hi! We have a use case that super-simplified wants to look like the following
Schema A
type ResponseConfirmation @shareable {
"""A string to display in the UI thanking the user for their response."""
confirmation: String
"""A copy of the submitted answer so the UI can confirm."""
submittedAnswer: String
}
type Mutation {
submitSurveyResponse(answer: String!): ResponseConfirmation
}
Schema B
type ResponseConfirmation @shareable {
confirmation: String @external
submittedAnswer: String @external
"""Using a fancy AI model, calculate a 'helpfulness score' rating based on the submitted answer"""
helpfulnessScore: Float @requires(fields: "submittedAnswer")
}
Query
mutation {
submitSurveyResponse(answer: "foo") {
confirmation
submittedAnswer
helpfulnessScore
}
}
^ obviously this doesn’t work because ResponseConfirmation
is not an Entity! (@external
/@requires
only works with entities afaik.)
We could give it a fake id: uuid()
field or something and make it a “fake” entity – (and not worry about the impacts it might have to normalized caching on clients )
This is clearly a hack - can we do any better?
Thanks!