code: public static function parseLiteral($valueNode)
      {
          // Note: throwing GraphQL\Error\Error vs \UnexpectedValueException to benefit from GraphQL
          // error location in query:
          if (!$valueNode instanceof StringValueNode) {
              throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, [$valueNode]);
          }
          if (!filter_var($valueNode->value, FILTER_VALIDATE_EMAIL)) {
              throw new Error("Not a valid email", [$valueNode]);
          }
          return $valueNode->value;
      }
docs: Parses an externally provided literal value (hardcoded in GraphQL query) to use as an input
  
  @param \GraphQL\Language\AST\Node $valueNode
  @return string
  @throws Error