Task: Fix Concept creation with parentId
Fix Concept creation with parentId
GraphQL KBConceptCreateInput accepts parentId, but createConcept fails when passing it to Prisma instead of the correct Parent relation.
Problem
When creating a Concept via the GraphQL input KBConceptCreateInput, it publicly includes the parentId field, but attempting to call createConcept with this field results in an error at the Prisma level.
In actual behavior, the resolver passes parentId directly to the Prisma create-data, whereas the Prisma schema expects a Parent relation.
Due to this, it is impossible to normally create a child Concept via the API, despite the GraphQL schema reporting that parentId is supported.
How to Reproduce
- Perform introspection on
KBConceptCreateInput— theparentIdfield is present. - Call
createConceptwith a validparentIdof an existing Concept. - Receive a Prisma error about an unknown field
parentId/ expecting aParentrelation.
The issue was discovered when attempting to create the Concept "Secure partial content editing by LLM agents" as a child of "Architectural problems of modern LLM agents".
What Needs to Be Done
Fix the resolver/input transformation layer so that parentId is correctly transformed into a Prisma relation, for example via Parent: { connect: { id: parentId } }, or in another way consistent with the current data model.
Check for a similar mapping for rootId if it is structured in the same way.
Definition of Done
createConceptwith a validparentIdsuccessfully creates a child Concept;- the created Concept returns the correct
parentId; - creating a Concept without
parentIdcontinues to work; - the GraphQL input and the actual resolver behavior no longer diverge.