Class InterfaceType
(experimental) Interface Types are abstract types that includes a certain set of fields that other types must include if they implement the interface.
Implements
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.AWS.AppSync.dll
Syntax (csharp)
public class InterfaceType : DeputyBase, IIntermediateType
Syntax (vb)
Public Class InterfaceType
Inherits DeputyBase
Implements IIntermediateType
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
var node = new InterfaceType("Node", new IntermediateTypeOptions {
Definition = new Dictionary<string, IField> {
{ "id", GraphqlType.String(new BaseTypeOptions { IsRequired = true }) }
}
});
var demo = new ObjectType("Demo", new ObjectTypeOptions {
InterfaceTypes = new [] { node },
Definition = new Dictionary<string, IField> {
{ "version", GraphqlType.String(new BaseTypeOptions { IsRequired = true }) }
}
});
Synopsis
Constructors
InterfaceType(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
InterfaceType(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
InterfaceType(String, IIntermediateTypeOptions) |
Properties
Definition | (experimental) the attributes of this type. |
Directives | (experimental) the directives for this object type. |
Modes | (experimental) the authorization modes for this intermediate type. |
Name | (experimental) the name of this type. |
Methods
AddField(IAddFieldOptions) | (experimental) Add a field to this Interface Type. |
Attribute(IBaseTypeOptions) | (experimental) Create a GraphQL Type representing this Intermediate Type. |
ToString() | (experimental) Generate the string of this object type. |
Constructors
InterfaceType(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected InterfaceType(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
InterfaceType(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected InterfaceType(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
InterfaceType(String, IIntermediateTypeOptions)
public InterfaceType(string name, IIntermediateTypeOptions props)
Parameters
- name System.String
- props IIntermediateTypeOptions
Remarks
Stability: Experimental
Properties
Definition
(experimental) the attributes of this type.
public virtual IDictionary<string, IField> Definition { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, IField>
Remarks
Stability: Experimental
Directives
(experimental) the directives for this object type.
public virtual Directive[] Directives { get; }
Property Value
Remarks
Default: - no directives
Stability: Experimental
Modes
(experimental) the authorization modes for this intermediate type.
protected virtual AuthorizationType[] Modes { get; set; }
Property Value
Remarks
Stability: Experimental
Name
(experimental) the name of this type.
public virtual string Name { get; }
Property Value
System.String
Remarks
Stability: Experimental
Methods
AddField(IAddFieldOptions)
(experimental) Add a field to this Interface Type.
public virtual void AddField(IAddFieldOptions options)
Parameters
- options IAddFieldOptions
the options to add a field.
Remarks
Interface Types must have both fieldName and field options.
Stability: Experimental
Attribute(IBaseTypeOptions)
(experimental) Create a GraphQL Type representing this Intermediate Type.
public virtual GraphqlType Attribute(IBaseTypeOptions options = null)
Parameters
- options IBaseTypeOptions
the options to configure this attribute.
Returns
Remarks
Stability: Experimental
ToString()
(experimental) Generate the string of this object type.
public override string ToString()
Returns
System.String
Remarks
Stability: Experimental