code: public function parseLiteral($valueNode, array $variables = null)
      {
          // 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 (!is_string($valueNode->value) || !filter_var($valueNode->value, FILTER_VALIDATE_URL)) {
              throw new Error('Query error: Not a valid URL', [$valueNode]);
          }
          return $valueNode->value;
      }
docs: Parses an externally provided literal value to use as an input (e.g. in Query AST)
  
  @param Node $valueNode
  @param array|null $variables
  @return null|string
  @throws Error