Open Migushthe2nd opened 3 years ago
Describe the bug When the PerchQueryBuilder executes it's query, it does not always SELECT the primary key. This can result in a
Cannot return null for non-nullable field Object.details.
if the GraphQL field is marked non-nullable. The TypeORM Repository.find() does always select the primary key, and thus does not cause an error.
Repository.find()
For this example, the object's details row in the db does not have a name, but it does have a message.
Example query:
query { objects { id details { name } } }
Example response:
{ id: 1, details: null, }
query { objects { id details { name message } } }
{ id: 1, details: { name: null, message: "hello!", } }
A relevant comment in the TypeORM repository: https://github.com/typeorm/typeorm/issues/5177#issuecomment-877825919
Expected behavior
Query:
Expected response:
{ id: 1, details: { name: null, } }
Example Code As basic as using
PerchQueryBuilder.find<Type>(repository, info);
Additional context v1.3.0
Describe the bug When the PerchQueryBuilder executes it's query, it does not always SELECT the primary key. This can result in a
if the GraphQL field is marked non-nullable. The TypeORM
Repository.find()
does always select the primary key, and thus does not cause an error.For this example, the object's details row in the db does not have a name, but it does have a message.
Example query:
Example response:
Example query:
Example response:
A relevant comment in the TypeORM repository: https://github.com/typeorm/typeorm/issues/5177#issuecomment-877825919
Expected behavior
Query:
Expected response:
Example Code As basic as using
Additional context v1.3.0