Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Name
- nameParser :: Parser Name
- newtype NameError = NameError Text
- unsafeMakeName :: HasCallStack => Text -> Name
- makeName :: Text -> Either NameError Name
- newtype QueryDocument = QueryDocument {
- getDefinitions :: [Definition]
- newtype SchemaDocument = SchemaDocument [TypeDefinition]
- data Definition
- data OperationDefinition
- data Node = Node Name [VariableDefinition] [Directive] SelectionSet
- getNodeName :: Node -> Name
- data VariableDefinition = VariableDefinition Variable Type (Maybe DefaultValue)
- newtype Variable = Variable Name
- type SelectionSet = [Selection]
- data Selection
- data Field = Field (Maybe Alias) Name [Argument] [Directive] SelectionSet
- type Alias = Name
- data Argument = Argument Name Value
- data FragmentSpread = FragmentSpread Name [Directive]
- data InlineFragment = InlineFragment (Maybe TypeCondition) [Directive] SelectionSet
- data FragmentDefinition = FragmentDefinition Name TypeCondition [Directive] SelectionSet
- type TypeCondition = NamedType
- data Value
- newtype StringValue = StringValue Text
- newtype ListValue = ListValue [Value]
- newtype ObjectValue = ObjectValue [ObjectField]
- data ObjectField = ObjectField Name Value
- type DefaultValue = Value
- data Directive = Directive Name [Argument]
- data Type
- newtype NamedType = NamedType Name
- newtype ListType = ListType Type
- data NonNullType
- data TypeDefinition
- = TypeDefinitionObject ObjectTypeDefinition
- | TypeDefinitionInterface InterfaceTypeDefinition
- | TypeDefinitionUnion UnionTypeDefinition
- | TypeDefinitionScalar ScalarTypeDefinition
- | TypeDefinitionEnum EnumTypeDefinition
- | TypeDefinitionInputObject InputObjectTypeDefinition
- | TypeDefinitionTypeExtension TypeExtensionDefinition
- data ObjectTypeDefinition = ObjectTypeDefinition Name Interfaces [FieldDefinition]
- type Interfaces = [NamedType]
- data FieldDefinition = FieldDefinition Name ArgumentsDefinition Type
- type ArgumentsDefinition = [InputValueDefinition]
- data InputValueDefinition = InputValueDefinition Name Type (Maybe DefaultValue)
- data InterfaceTypeDefinition = InterfaceTypeDefinition Name [FieldDefinition]
- data UnionTypeDefinition = UnionTypeDefinition Name [NamedType]
- newtype ScalarTypeDefinition = ScalarTypeDefinition Name
- data EnumTypeDefinition = EnumTypeDefinition Name [EnumValueDefinition]
- newtype EnumValueDefinition = EnumValueDefinition Name
- data InputObjectTypeDefinition = InputObjectTypeDefinition Name [InputValueDefinition]
- newtype TypeExtensionDefinition = TypeExtensionDefinition ObjectTypeDefinition
Documentation
A name in GraphQL.
An invalid name.
unsafeMakeName :: HasCallStack => Text -> Name Source #
makeName :: Text -> Either NameError Name Source #
Create a Name
.
Names must match the regex [_A-Za-z][_0-9A-Za-z]*
. If the given text does
not match, return Nothing.
>>>
makeName "foo"
Right (Name {unName = "foo"})>>>
makeName "9-bar"
Left (NameError "9-bar")
newtype QueryDocument Source #
A QueryDocument
is something a user might send us.
https://facebook.github.io/graphql/#sec-Language.Query-Document
newtype SchemaDocument Source #
A SchemaDocument
is a document that defines a GraphQL schema.
data Definition Source #
data OperationDefinition Source #
getNodeName :: Node -> Name Source #
data VariableDefinition Source #
type SelectionSet = [Selection] Source #
data FragmentSpread Source #
data InlineFragment Source #
data FragmentDefinition Source #
type TypeCondition = NamedType Source #
newtype StringValue Source #
newtype ObjectValue Source #
data ObjectField Source #
type DefaultValue = Value Source #
data NonNullType Source #
data TypeDefinition Source #
data ObjectTypeDefinition Source #
type Interfaces = [NamedType] Source #
data FieldDefinition Source #
type ArgumentsDefinition = [InputValueDefinition] Source #
data InputValueDefinition Source #
data UnionTypeDefinition Source #
newtype ScalarTypeDefinition Source #
data EnumTypeDefinition Source #
newtype EnumValueDefinition Source #