Class ObjectType
(experimental) Object Types are types declared by you.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.AWS.AppSync.dll
Syntax (csharp)
public class ObjectType : InterfaceType, IIntermediateType
Syntax (vb)
Public Class ObjectType
Inherits InterfaceType
Implements IIntermediateType
Remarks
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
ObjectType(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ObjectType(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
ObjectType(String, IObjectTypeOptions) |
Properties
InterfaceTypes | (experimental) The Interface Types this Object Type implements. |
Resolvers | (experimental) The resolvers linked to this data source. |
Methods
AddField(IAddFieldOptions) | (experimental) Add a field to this Object Type. |
GenerateResolver(IGraphqlApi, String, IResolvableFieldOptions) | (experimental) Generate the resolvers linked to this Object Type. |
ToString() | (experimental) Generate the string of this object type. |
Constructors
ObjectType(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ObjectType(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ObjectType(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ObjectType(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
ObjectType(String, IObjectTypeOptions)
public ObjectType(string name, IObjectTypeOptions props)
Parameters
- name System.String
- props IObjectTypeOptions
Remarks
Stability: Experimental
Properties
InterfaceTypes
(experimental) The Interface Types this Object Type implements.
public virtual InterfaceType[] InterfaceTypes { get; }
Property Value
Remarks
Default: - no interface types
Stability: Experimental
Resolvers
(experimental) The resolvers linked to this data source.
public virtual Resolver[] Resolvers { get; set; }
Property Value
Resolver[]
Remarks
Stability: Experimental
Methods
AddField(IAddFieldOptions)
(experimental) Add a field to this Object Type.
public override void AddField(IAddFieldOptions options)
Parameters
- options IAddFieldOptions
the options to add a field.
Overrides
Remarks
Object Types must have both fieldName and field options.
Stability: Experimental
GenerateResolver(IGraphqlApi, String, IResolvableFieldOptions)
(experimental) Generate the resolvers linked to this Object Type.
protected virtual Resolver GenerateResolver(IGraphqlApi api, string fieldName, IResolvableFieldOptions options = null)
Parameters
- api IGraphqlApi
- fieldName System.String
- options IResolvableFieldOptions
Returns
Remarks
Stability: Experimental
ToString()
(experimental) Generate the string of this object type.
public override string ToString()
Returns
System.String
Overrides
Remarks
Stability: Experimental