mirror of
https://github.com/openappsec/openappsec.git
synced 2025-11-16 17:31:52 +03:00
Feb 15th 2023 update
This commit is contained in:
55
external/graphqlparser/GraphQLParser.h
vendored
Normal file
55
external/graphqlparser/GraphQLParser.h
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Copyright 2019-present, GraphQL Foundation
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The purpose of this file is to provide a nice interface to parsing
|
||||
* GraphQL, rather than the old-fashioned interface provided by bison
|
||||
* and flex.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <stdio.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace graphql {
|
||||
|
||||
namespace ast {
|
||||
class Node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given GraphQL source string, returning an AST. Returns
|
||||
* nullptr on error and, if error is not null, places a string
|
||||
* describing what went wrong in error that must be freed with free(3).
|
||||
*/
|
||||
std::unique_ptr<ast::Node> parseString(const char *text, const char **error);
|
||||
|
||||
/**
|
||||
* Like parseString, but enables support for the experimental type
|
||||
* definition syntax from https://github.com/facebook/graphql/pull/90 .
|
||||
*/
|
||||
std::unique_ptr<ast::Node> parseStringWithExperimentalSchemaSupport(
|
||||
const char *text, const char **error);
|
||||
|
||||
/**
|
||||
* Read and parse GraphQL source from the given file, returning an
|
||||
* AST. Returns nullptr on error and, if error is not null, places an
|
||||
* error string in error that must be freed with free(3).
|
||||
*/
|
||||
std::unique_ptr<ast::Node> parseFile(FILE *file, const char **error);
|
||||
|
||||
/**
|
||||
* Like parseFile, but enables support for the experimental type
|
||||
* definition syntax from https://github.com/facebook/graphql/pull/90 .
|
||||
*/
|
||||
std::unique_ptr<ast::Node> parseFileWithExperimentalSchemaSupport(
|
||||
FILE *file, const char **error);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user