Class GraphqlType
(experimental) The GraphQL Types in AppSync's GraphQL.
Implements
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.AWS.AppSync.dll
Syntax (csharp)
public class GraphqlType : DeputyBase, IField
Syntax (vb)
Public Class GraphqlType
Inherits DeputyBase
Implements IField
Remarks
GraphQL Types are the building blocks for object types, queries, mutations, etc. They are types like String, Int, Id or even Object Types you create.
i.e. String
, String!
, [String]
, [String!]
, [String]!
GraphQL Types are used to define the entirety of schema.
Stability: Experimental
ExampleMetadata: infused
Examples
GraphqlApi api;
MappingTemplate dummyRequest;
MappingTemplate dummyResponse;
var info = new ObjectType("Info", new ObjectTypeOptions {
Definition = new Dictionary<string, IField> {
{ "node", new ResolvableField(new ResolvableFieldOptions {
ReturnType = GraphqlType.String(),
Args = new Dictionary<string, GraphqlType> {
{ "id", GraphqlType.String() }
},
DataSource = api.AddNoneDataSource("none"),
RequestMappingTemplate = dummyRequest,
ResponseMappingTemplate = dummyResponse
}) }
}
});
Synopsis
Constructors
GraphqlType(Type, IGraphqlTypeOptions) | |
GraphqlType(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
GraphqlType(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
IntermediateType | (experimental) the intermediate type linked to this attribute (i.e. an interface or an object). |
IsList | (experimental) property determining if this attribute is a list i.e. if true, attribute would be |
IsRequired | (experimental) property determining if this attribute is non-nullable i.e. if true, attribute would be |
IsRequiredList | (experimental) property determining if this attribute is a non-nullable list i.e. if true, attribute would be |
Type | (experimental) the type of attribute. |
Methods
ArgsToString() | (experimental) Generate the arguments for this field. |
AwsDate(IBaseTypeOptions) | (experimental) |
AwsDateTime(IBaseTypeOptions) | (experimental) |
AwsEmail(IBaseTypeOptions) | (experimental) |
AwsIpAddress(IBaseTypeOptions) | (experimental) |
AwsJson(IBaseTypeOptions) | (experimental) |
AwsPhone(IBaseTypeOptions) | (experimental) |
AwsTime(IBaseTypeOptions) | (experimental) |
AwsTimestamp(IBaseTypeOptions) | (experimental) |
AwsUrl(IBaseTypeOptions) | (experimental) |
Boolean(IBaseTypeOptions) | (experimental) |
DirectivesToString(AuthorizationType[]) | (experimental) Generate the directives for this field. |
Float(IBaseTypeOptions) | (experimental) |
Id(IBaseTypeOptions) | (experimental) |
Int(IBaseTypeOptions) | (experimental) |
Intermediate(IGraphqlTypeOptions) | (experimental) an intermediate type to be added as an attribute (i.e. an interface or an object type). |
String(IBaseTypeOptions) | (experimental) |
ToString() | (experimental) Generate the string for this attribute. |
Constructors
GraphqlType(Type, IGraphqlTypeOptions)
public GraphqlType(Type type, IGraphqlTypeOptions options = null)
Parameters
- type Type
- options IGraphqlTypeOptions
Remarks
Stability: Experimental
GraphqlType(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected GraphqlType(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
GraphqlType(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected GraphqlType(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
IntermediateType
(experimental) the intermediate type linked to this attribute (i.e. an interface or an object).
public virtual IIntermediateType IntermediateType { get; }
Property Value
Remarks
Default: - no intermediate type
Stability: Experimental
IsList
(experimental) property determining if this attribute is a list i.e. if true, attribute would be [Type]
.
public virtual bool IsList { get; }
Property Value
System.Boolean
Remarks
Default: - false
Stability: Experimental
IsRequired
(experimental) property determining if this attribute is non-nullable i.e. if true, attribute would be Type!
and this attribute must always have a value.
public virtual bool IsRequired { get; }
Property Value
System.Boolean
Remarks
Default: - false
Stability: Experimental
IsRequiredList
(experimental) property determining if this attribute is a non-nullable list i.e. if true, attribute would be [ Type ]!
and this attribute's list must always have a value.
public virtual bool IsRequiredList { get; }
Property Value
System.Boolean
Remarks
Default: - false
Stability: Experimental
Type
(experimental) the type of attribute.
public virtual Type Type { get; }
Property Value
Remarks
Stability: Experimental
Methods
ArgsToString()
(experimental) Generate the arguments for this field.
public virtual string ArgsToString()
Returns
System.String
Remarks
Stability: Experimental
AwsDate(IBaseTypeOptions)
(experimental) AWSDate
scalar type represents a valid extended ISO 8601 Date
string.
public static GraphqlType AwsDate(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
In other words, accepts date strings in the form of YYYY-MM-DD
. It accepts time zone offsets.
Stability: Experimental
AwsDateTime(IBaseTypeOptions)
(experimental) AWSDateTime
scalar type represents a valid extended ISO 8601 DateTime
string.
public static GraphqlType AwsDateTime(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
In other words, accepts date strings in the form of YYYY-MM-DDThh:mm:ss.sssZ
. It accepts time zone offsets.
Stability: Experimental
AwsEmail(IBaseTypeOptions)
(experimental) AWSEmail
scalar type represents an email address string (i.e.username@example.com
).
public static GraphqlType AwsEmail(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
Stability: Experimental
AwsIpAddress(IBaseTypeOptions)
(experimental) AWSIPAddress
scalar type respresents a valid IPv4
of IPv6
address string.
public static GraphqlType AwsIpAddress(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
Stability: Experimental
AwsJson(IBaseTypeOptions)
(experimental) AWSJson
scalar type represents a JSON string.
public static GraphqlType AwsJson(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
Stability: Experimental
AwsPhone(IBaseTypeOptions)
(experimental) AWSPhone
scalar type represents a valid phone number. Phone numbers maybe be whitespace delimited or hyphenated.
public static GraphqlType AwsPhone(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
The number can specify a country code at the beginning, but is not required for US phone numbers.
Stability: Experimental
AwsTime(IBaseTypeOptions)
(experimental) AWSTime
scalar type represents a valid extended ISO 8601 Time
string.
public static GraphqlType AwsTime(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
In other words, accepts date strings in the form of hh:mm:ss.sss
. It accepts time zone offsets.
Stability: Experimental
AwsTimestamp(IBaseTypeOptions)
(experimental) AWSTimestamp
scalar type represents the number of seconds since 1970-01-01T00:00Z
.
public static GraphqlType AwsTimestamp(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
Timestamps are serialized and deserialized as numbers.
Stability: Experimental
AwsUrl(IBaseTypeOptions)
(experimental) AWSURL
scalar type represetns a valid URL string.
public static GraphqlType AwsUrl(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
URLs wihtout schemes or contain double slashes are considered invalid.
Stability: Experimental
Boolean(IBaseTypeOptions)
(experimental) Boolean
scalar type is a boolean value: true or false.
public static GraphqlType Boolean(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
Stability: Experimental
DirectivesToString(AuthorizationType[])
(experimental) Generate the directives for this field.
public virtual string DirectivesToString(AuthorizationType[] modes = null)
Parameters
- modes AuthorizationType[]
Returns
System.String
Remarks
Stability: Experimental
Float(IBaseTypeOptions)
(experimental) Float
scalar type is a signed double-precision fractional value.
public static GraphqlType Float(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
Stability: Experimental
Id(IBaseTypeOptions)
(experimental) ID
scalar type is a unique identifier. ID
type is serialized similar to String
.
public static GraphqlType Id(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
Often used as a key for a cache and not intended to be human-readable.
Stability: Experimental
Int(IBaseTypeOptions)
(experimental) Int
scalar type is a signed non-fractional numerical value.
public static GraphqlType Int(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
Stability: Experimental
Intermediate(IGraphqlTypeOptions)
(experimental) an intermediate type to be added as an attribute (i.e. an interface or an object type).
public static GraphqlType Intermediate(IGraphqlTypeOptions options = null)
Parameters
- options IGraphqlTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList - intermediateType.
Returns
Remarks
Stability: Experimental
String(IBaseTypeOptions)
(experimental) String
scalar type is a free-form human-readable text.
public static GraphqlType String(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute - isList - isRequired - isRequiredList.
Returns
Remarks
Stability: Experimental
ToString()
(experimental) Generate the string for this attribute.
public override string ToString()
Returns
System.String
Remarks
Stability: Experimental