Skip to content

Invalid query is not rejected #412

Open
@imor

Description

@imor

Describe the bug
A query which doesn't specify any subfields on a non-scalar field should be rejected.

To Reproduce

Run the following SQL:

create table account(
    id serial primary key,
    email varchar(255) not null
);

select jsonb_pretty(graphql.resolve($$
    query {
        accountCollection
    }
$$));

Observe that the above GraphQL query returns:

           jsonb_pretty
-----------------------------------
 {                                +
     "data": {                    +
         "accountCollection": null+
     }                            +
 }
(1 row)

Expected behavior
The query should be rejected with an error message because the accountCollection field has id and email sub-fields.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions