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

Return empty array instead of null #96

Open
EinDev opened this issue Jul 8, 2021 · 0 comments
Open

Return empty array instead of null #96

EinDev opened this issue Jul 8, 2021 · 0 comments

Comments

@EinDev
Copy link

EinDev commented Jul 8, 2021

I'm pretty new to GraphQL, maybe this is a user-error.
Let's say i have a table "person" with the following JSON Schema:

{
    type: 'array',
    required: ['username'],
    properties: {
        username: { type: 'string' },
        stringList: {
            type: 'array',
            items: {
                type: 'string'
            }
        }
    }
}

And the following GraphQL-Query:

{
    profile(username: "test") {
        stringList
    }
}

I would expect it to return:

{
    stringList: []
}

But it returns:

{
    stringList: null
}

According to some StackOverflow Post i would need to modify the GraphQL-Schema, that gets generated by objection-graphql.
Is there any way to achieve this with objection-graphql?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant