Merge pull request #324 from bkonetzny/docs-scalar-method-signature

Fixed method signature in custom scalar docs
This commit is contained in:
Vladimir Razuvaev 2018-08-20 17:40:06 +07:00 committed by GitHub
commit dbeaf46631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,10 +96,11 @@ class EmailType extends ScalarType
* }
*
* @param \GraphQL\Language\AST\Node $valueNode
* @param array|null $variables
* @return string
* @throws Error
*/
public function parseLiteral($valueNode)
public function parseLiteral($valueNode, array $variables = null)
{
// Note: throwing GraphQL\Error\Error vs \UnexpectedValueException to benefit from GraphQL
// error location in query:
@ -124,6 +125,6 @@ $emailType = new CustomScalarType([
'name' => 'Email',
'serialize' => function($value) {/* See function body above */},
'parseValue' => function($value) {/* See function body above */},
'parseLiteral' => function($valueNode) {/* See function body above */},
'parseLiteral' => function($valueNode, array $variables = null) {/* See function body above */},
]);
```