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

Duplicate variable names with 'variables' and others #4

Open
ash0080 opened this issue Feb 10, 2018 · 0 comments
Open

Duplicate variable names with 'variables' and others #4

ash0080 opened this issue Feb 10, 2018 · 0 comments

Comments

@ash0080
Copy link
Contributor

ash0080 commented Feb 10, 2018

In test example,

methodArgs: {
    last: {__variable__: 'last'}
  },
variables: {
    last: ''
  },
types: {
    last: 'LAST'
  },

output: body: 'query test($last: LAST!) {\n    testMethod(last: $last, last: $last){\n    id\n\n  }\n  }',

don't know why passing a value in variables, it is useless. cuz variable's value is passed from outside of the graphql-tag, it only defines a name here. doc

actually, I don't think variables should be an object, It should be a keys array, cuz, it only define the variable types

so __variable__ is useless too, cuz we alway need define variable names with a named operation

now, the 'methodArgs', 'variables', 'types' design looks superfluous and not easy to use
maybe you should plan well

if keeping the variables still accept an object, I think the key:value <--- value should be an TYPE definition

I guess maybe you want the variable accept a default value? but seems it not work as expect

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