Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid query is not rejected #412

Open
imor opened this issue Sep 6, 2023 · 0 comments
Open

Invalid query is not rejected #412

imor opened this issue Sep 6, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@imor
Copy link
Contributor

imor commented Sep 6, 2023

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:

@imor imor added the bug Something isn't working label Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants