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

Shortcut for queries returning a GraphQLList ? #15

Open
ghost opened this issue May 25, 2017 · 3 comments
Open

Shortcut for queries returning a GraphQLList ? #15

ghost opened this issue May 25, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented May 25, 2017

Instead of writing

def schema = DSL.schema {
        queries {
            field('history') {
                type new GraphQLList(GraphQLHistory)
                fetcher {env -> return DATA}
            }
        }
    }

I would like to write:

def schema = DSL.schema {
        queries {
            field('history') {
                type [GraphQLHistory]
                fetcher {env -> return DATA}
            }
        }
    }

@ghost
Copy link
Author

ghost commented May 25, 2017

Just realized that I can write:

 queries {
            field('history') {
                type list(GraphQLHistory)
                fetcher {env -> return DATA}
            }
        }

@mariogarcia
Copy link
Contributor

Thanks for the feedback. I've thought about this as well but I was expecting more feedback before changing anything. If I'm not wrong you were expecting something more similar to GraphQL schema definition, something like:

type GraphQLHistory // single type
type [GraphQLHistory] // list type

That is very feasible. It would mean that the related DSL supporting methods would be:

type(Class<GraphQLType> type) // single type
type(List<Class<GraphQLType>> listType) // list type

I will think about it in upcoming versions, but first I'm focusing on having a relay implementation which I think is more important. Then I will probably do a release with all received feedback like yours :)

Thanks again for the feedback, it's really important to improve the project.

@ghost
Copy link
Author

ghost commented May 26, 2017

Thanks four your answer. It's great that there is a nice GraphQL DSL for the JVM.

@mariogarcia mariogarcia modified the milestone: Unknown May 31, 2017
@mariogarcia mariogarcia modified the milestones: Unknown, 0.2.1 Jan 28, 2018
@mariogarcia mariogarcia removed this from the 0.2.1 milestone May 31, 2018
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