mirror of
https://github.com/openappsec/openappsec.git
synced 2025-10-01 20:17:43 +03:00
Feb 15th 2023 update
This commit is contained in:
35
external/graphqlparser/c/GraphQLParser.cpp
vendored
Normal file
35
external/graphqlparser/c/GraphQLParser.cpp
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "GraphQLParser.h"
|
||||
#include "../GraphQLParser.h"
|
||||
#include "../AstNode.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
struct GraphQLAstNode *graphql_parse_string(const char *text, const char **error) {
|
||||
return reinterpret_cast<struct GraphQLAstNode *>(facebook::graphql::parseString(text, error).release());
|
||||
}
|
||||
|
||||
struct GraphQLAstNode *graphql_parse_string_with_experimental_schema_support(
|
||||
const char *text, const char **error) {
|
||||
return reinterpret_cast<struct GraphQLAstNode *>(facebook::graphql::parseStringWithExperimentalSchemaSupport(
|
||||
text, error).release());
|
||||
}
|
||||
|
||||
struct GraphQLAstNode *graphql_parse_file(FILE *file, const char **error) {
|
||||
return reinterpret_cast<struct GraphQLAstNode *>(facebook::graphql::parseFile(file, error).release());
|
||||
}
|
||||
|
||||
struct GraphQLAstNode *graphql_parse_file_with_experimental_schema_support(
|
||||
FILE *file, const char **error) {
|
||||
return reinterpret_cast<struct GraphQLAstNode *>(facebook::graphql::parseFileWithExperimentalSchemaSupport(file, error).release());
|
||||
}
|
||||
|
||||
void graphql_error_free(const char *error) {
|
||||
std::free((void *)(error)); // NOLINT
|
||||
}
|
Reference in New Issue
Block a user