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

Use query alias as GraphQL specification #1

Open
mariogarcia opened this issue Apr 20, 2017 · 0 comments
Open

Use query alias as GraphQL specification #1

mariogarcia opened this issue Apr 20, 2017 · 0 comments

Comments

@mariogarcia
Copy link
Contributor

At the moment the alias is added as a method call at the end of the query:

import gql.DSL

def result = DSL.execute(schema) {
  query('byYear', [year: '1962']) {
    returns(Film) {
      title
      year
    }
    alias 'first'
  }

  query('byYear', [year: '2015']) {
    returns {
      title
      year
      bond
    }
    alias 'last'
  }
}

It would be great to use statement labels as query alias. Something like this:

import gql.DSL

def result = DSL.execute(schema) {
  first: query('byYear', [year: '1962']) {
    returns(Film) {
      title
      year
    }
  }

  last: query('byYear', [year: '2015']) {
    returns {
      title
      year
      bond
    }
  }
}

That I think should involve an AST transform.

@mariogarcia mariogarcia added this to the 0.2.0 milestone Apr 22, 2017
@mariogarcia mariogarcia modified the milestones: Unknown, 0.2.0 Jun 11, 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
Projects
None yet
Development

No branches or pull requests

1 participant