0

I have this type defined:

"Convo object type"
type Convo {
    "The Neptune Conversation identifier"
    id: String
    "A key for the Convo"
    key: String
    "The date the conversation was created"
    createDateTime: String
    "If isHead == true then it is question otherwise a response"
    isHead: Boolean
    "The user id"
    userId: String
    "The category of the conversation"
    threadCategory: String
    "The subject of the conversation"   
    subject: String
    "The text of the conversation"
    content: String
    "Responses to the conversation"
    responses: [Convo]
}

I need to return a query and get the conversation and the responses and the responses for those responses.

{
    "query" : "{ GetQuestionsForAsset(asset_id: \"11c4d3a7-0ae0-410d-a310-62eb20e8f87f\") {id key createDateTime isHead userId threadCategory subject content responses {id key createDateTime isHead userId threadCategory subject content  } }}"
}

I have my graphql schema defined in Python. I have seen online that I need to use fragments. Are those defined in the query or in the graphql schema?

Greg Finzer
  • 6,714
  • 21
  • 80
  • 125
  • Fragment is a reusable piece of code, define it in schema then use in query https://graphql.org/learn/queries/#fragments – Prince Agrawal Apr 15 '22 at 20:56
  • I defined the fragment in the schema and I am getting this error when referencing the fragment: Unknown fragment 'responsesField This is what I have defined for the fragment: fragment responsesField on Convo { responses } – Greg Finzer Apr 18 '22 at 12:35

0 Answers0