You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The resolver for a nested entity (batchCode in this case) is failing at runtime when I have selected a list of entities with a child entity. The selection is coming off the result of a custom mutation.
Cannot read properties of undefined (reading 'batchCode')\n at id .../src/packages/backend/.graphweaver/backend/index.js:768:51)\n at _listRelationshipField (.../src/node_modules/.pnpm/@[email protected][email protected]/node_modules/@exogee/graphweaver/lib/resolvers.js:380:15)
I believe the problem is at this line of code. The source must be a graphql entity that does not have the 'dataEntity' populated
So, the solution here I'm 99% sure is to call fromBackendEntity() on the things you get back before you return them. It could be nice to not have to do this, but I think what we should do now is:
Provide a clear example of how to do custom mutations and queries in the examples folder.
This should include nested results from a custom mutation and custom query.
Update the docs to have a page on this specifically so that someone who wants to implement custom queries and / or mutations understands how to:
Register them
Build a resolver
How to disable all built in queries and mutations for an entity.
The security implications (we don't enforce ACLs for custom queries and mutations so they'll need to do it themselves).
Joining back to the default resolvers, e.g. here's a custom query that returns tasks.
Describe the bug
The resolver for a nested entity (batchCode in this case) is failing at runtime when I have selected a list of entities with a child entity. The selection is coming off the result of a custom mutation.
I believe the problem is at this line of code. The source must be a graphql entity that does not have the 'dataEntity' populated
graphweaver/src/packages/core/src/resolvers.ts
Line 566 in c5cfe2a
To Reproduce
Steps to reproduce the behavior:
Expected behavior
This should not fail at runtime
Actual behavior
It throws an error
Screenshots or Screencasts
Desktop (please complete the following information):
Additional context
@thekevinbrown has a pretty good sense of what is probably wrong here
The text was updated successfully, but these errors were encountered: