graphql-engine/server/src-lib/Hasura/GraphQL/Parser.hs
Samir Talwar f01c7f4ee6 server: Remove QErr and Code dependencies from the schema parsers.
In the process of decoupling the schema parsers from the GraphQL Engine, we need to remove dependencies on `Hasura.Base.Error`.

First of all, we have avoided using `QErr` in schema parsers code, instead returning a more appropriate data type which can be converted to a `Hasura.Base.Error.QErr` later.

Secondly, we create a new `ParseErrorCode` type to represent parse failure types, which are then converted to a `Hasura.Base.Error.Code` later.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5181
GitOrigin-RevId: 8655e26adb1e7d5e3d552c77a8a403f987b53467
2022-07-27 12:26:44 +00:00

74 lines
1.7 KiB
Haskell

-- | This module exports the public API to our internal GraphQL query parser
-- combinator language. For more details, see the documentation for 'Parser'.
module Hasura.GraphQL.Parser
( Directive (..),
InputFieldsParser (..),
FieldParser (..),
ParsedSelection (..),
Parser (..),
parserType,
runParser,
bind,
bindField,
bindFields,
boolean,
int,
float,
string,
identifier,
uuid,
json,
jsonb,
nonNegativeInt,
bigInt,
scientific,
unsafeRawScalar,
jsonScalar,
enum,
nullable,
nullableParser,
nonNullableParser,
multiple,
setParserOrigin,
setFieldParserOrigin,
setInputFieldsParserOrigin,
list,
object,
selectionSet,
safeSelectionSet,
selectionSetInterface,
selectionSetObject,
selectionSetUnion,
field,
fieldWithDefault,
fieldOptional,
wrapFieldParser,
handleTypename,
selection,
rawSelection,
selection_,
subselection,
rawSubselection,
subselection_,
jsonToGraphQL,
valueToJSON,
module Hasura.GraphQL.Parser.Class,
module Hasura.GraphQL.Parser.ErrorCode,
module Hasura.GraphQL.Parser.Monad,
module Hasura.GraphQL.Parser.Names,
module Hasura.GraphQL.Parser.Schema,
module Hasura.GraphQL.Parser.Variable,
)
where
import Hasura.GraphQL.Parser.Class
import Hasura.GraphQL.Parser.Directives
import Hasura.GraphQL.Parser.ErrorCode
import Hasura.GraphQL.Parser.Internal.Convert
import Hasura.GraphQL.Parser.Internal.Parser
import Hasura.GraphQL.Parser.Internal.Scalars
import Hasura.GraphQL.Parser.Monad
import Hasura.GraphQL.Parser.Names
import Hasura.GraphQL.Parser.Schema
import Hasura.GraphQL.Parser.Variable