{"action":"opened","issue":{"url":"https://api.github.com/repos/ajagnanan1/resto-1/issues/167","repository_url":"https://api.github.com/repos/ajagnanan1/resto-1","labels_url":"https://api.github.com/repos/ajagnanan1/resto-1/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/ajagnanan1/resto-1/issues/167/comments","events_url":"https://api.github.com/repos/ajagnanan1/resto-1/issues/167/events","html_url":"https://github.com/ajagnanan1/resto-1/issues/167","id":299226770,"number":167,"title":"parameterized query variable values aren't passed to parseLiteral of GraphQLScalarTypes","user":{"login":"ajagnanan1","id":17330249,"avatar_url":"https://avatars0.githubusercontent.com/u/17330249?v=4","gravatar_id":"","url":"https://api.github.com/users/ajagnanan1","html_url":"https://github.com/ajagnanan1","followers_url":"https://api.github.com/users/ajagnanan1/followers","following_url":"https://api.github.com/users/ajagnanan1/following{/other_user}","gists_url":"https://api.github.com/users/ajagnanan1/gists{/gist_id}","starred_url":"https://api.github.com/users/ajagnanan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajagnanan1/subscriptions","organizations_url":"https://api.github.com/users/ajagnanan1/orgs","repos_url":"https://api.github.com/users/ajagnanan1/repos","events_url":"https://api.github.com/users/ajagnanan1/events{/privacy}","received_events_url":"https://api.github.com/users/ajagnanan1/received_events","type":"User","site_admin":false},"labels":[{"id":844629108,"url":"https://api.github.com/repos/ajagnanan1/resto-1/labels/documentation","name":"documentation","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-22T05:27:36Z","updated_at":"2018-02-22T05:27:36Z","closed_at":null,"author_association":"OWNER","body":"#433 Issue by __jedwards1211__\n\nWhen I call my login method like this, it calls my Password type's `parseLiteral` method which throws an error as expected:\n\n``` graphql\nquery {\n  login(username:\"andy\", password:\"aaaaaaaaa\") {\n    authToken\n  }\n}\n```\n\nResult:\n\n```\n{ errors: \n   [ [Error: Password did not met strength requirements:\n     The password must be at least 10 characters long.\n     The password may not contain sequences of three or more repeated characters.] ] }\n```\n\nBut if I change that to a parameterized query with the same values in the variables, it never calls my Password type's `parseLiteral`, and it succeeds.  Am I misunderstanding something, or is this a bug?  I couldn't find anything in the documentation about different validation behavior for parameterized queries.\n\n``` graphql\nquery ($username: Username, $email: Email, $password: Password!) {\n  login(username: $username, email: $email, password: $password) {\n    authToken\n  }\n}\n```\n\nVariables:\n\n``` json\n{\n  \"username\": \"andy\",\n  \"password\": \"aaaaaaaaa\"\n}\n```\n\nResult:\n\n``` json\n{\n  \"data\": {\n    \"login\": {\n      \"authToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjFlMzM3MzliLTlhYjktNDczZi04NTMxLThmYjhkOWFjMjYyZCIsImlhdCI6MTQ2ODQ2NTc2MywiZXhwIjoxNDY5MDcwNTYzfQ.pcedaOASV8U2-fBHnGxQlHs26SyhuTzLZC1T3EVgndI\"\n    }\n  }\n}\n```\n\nHere is my Password type:\n\n``` js\nexport const GraphQLPasswordType = new GraphQLScalarType({\n  name: 'Password',\n  serialize: value => String(value),\n  parseValue: value => String(value),\n  parseLiteral: ast => {\n    if (ast.kind !== Kind.STRING) {\n      throw new GraphQLError(`Password is not a string, it is a: ${ast.kind}`, [ast])\n    }\n    const result = testPassword(ast.value)\n    if (result.requiredTestErrors && result.requiredTestErrors.length) {\n      throw new GraphQLError(`Password did not met strength requirements:\n${result.requiredTestErrors.join('\\n')}`, [ast])\n    }\n    return String(ast.value)\n  }\n})\n```\n\nAnd the login query schema:\n\n``` js\n  login: {\n    type: UserWithAuthToken,\n    args: {\n      username: {type: GraphQLUsernameType},\n      email: {type: GraphQLEmailType},\n      password: {type: new GraphQLNonNull(GraphQLPasswordType)}\n    },\n    async resolve(source, args) {\n      ...\n```\n"}}
{"actor":{"display_login":"ajagnanan1"}}