@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:03.150Z") @Stability(value=Experimental) public class Schema extends software.amazon.jsii.JsiiObject
If no options are configured, schema will be generated code-first.
Example:
GraphqlApi api = GraphqlApi.Builder.create(this, "api")
.name("api")
.schema(Schema.fromAsset(join(__dirname, "schema.graphql")))
.build();
HttpDataSource httpDs = api.addHttpDataSource("ds", "https://states.amazonaws.com", HttpDataSourceOptions.builder()
.name("httpDsWithStepF")
.description("from appsync to StepFunctions Workflow")
.authorizationConfig(AwsIamConfig.builder()
.signingRegion("us-east-1")
.signingServiceName("states")
.build())
.build());
httpDs.createResolver(BaseResolverProps.builder()
.typeName("Mutation")
.fieldName("callStepFunction")
.requestMappingTemplate(MappingTemplate.fromFile("request.vtl"))
.responseMappingTemplate(MappingTemplate.fromFile("response.vtl"))
.build());
| Modifier and Type | Class and Description |
|---|---|
static class |
Schema.Builder
(experimental) A fluent builder for
Schema. |
| Modifier | Constructor and Description |
|---|---|
|
Schema() |
protected |
Schema(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Schema(software.amazon.jsii.JsiiObjectRef objRef) |
|
Schema(SchemaOptions options) |
| Modifier and Type | Method and Description |
|---|---|
ObjectType |
addMutation(String fieldName,
ResolvableField field)
(experimental) Add a mutation field to the schema's Mutation.
|
ObjectType |
addQuery(String fieldName,
ResolvableField field)
(experimental) Add a query field to the schema's Query.
|
ObjectType |
addSubscription(String fieldName,
Field field)
(experimental) Add a subscription field to the schema's Subscription.
|
void |
addToSchema(String addition)
(experimental) Escape hatch to add to Schema as desired.
|
void |
addToSchema(String addition,
String delimiter)
(experimental) Escape hatch to add to Schema as desired.
|
IIntermediateType |
addType(IIntermediateType type)
(experimental) Add type to the schema.
|
CfnGraphQLSchema |
bind(GraphqlApi api)
(experimental) Called when the GraphQL Api is initialized to allow this object to bind to the stack.
|
static Schema |
fromAsset(String filePath)
(experimental) Generate a Schema from file.
|
String |
getDefinition()
(experimental) The definition for this schema.
|
void |
setDefinition(String value)
(experimental) The definition for this schema.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Schema(software.amazon.jsii.JsiiObjectRef objRef)
protected Schema(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public Schema(@Nullable
SchemaOptions options)
options - @Stability(value=Experimental) public Schema()
@Stability(value=Experimental) @NotNull public static Schema fromAsset(@NotNull String filePath)
filePath - the file path of the schema file. This parameter is required.@Stability(value=Experimental) @NotNull public ObjectType addMutation(@NotNull String fieldName, @NotNull ResolvableField field)
type Mutation { fieldName: Field.returnType }
fieldName - the name of the Mutation. This parameter is required.field - the resolvable field to for this Mutation. This parameter is required.@Stability(value=Experimental) @NotNull public ObjectType addQuery(@NotNull String fieldName, @NotNull ResolvableField field)
type Query { fieldName: Field.returnType }
fieldName - the name of the query. This parameter is required.field - the resolvable field to for this query. This parameter is required.@Stability(value=Experimental) @NotNull public ObjectType addSubscription(@NotNull String fieldName, @NotNull Field field)
type Subscription { fieldName: Field.returnType }
fieldName - the name of the Subscription. This parameter is required.field - the resolvable field to for this Subscription. This parameter is required.@Stability(value=Experimental)
public void addToSchema(@NotNull
String addition,
@Nullable
String delimiter)
Will always result in a newline.
Default: - ''
addition - the addition to add to schema. This parameter is required.delimiter - the delimiter between schema and addition.@Stability(value=Experimental)
public void addToSchema(@NotNull
String addition)
Will always result in a newline.
Default: - ''
addition - the addition to add to schema. This parameter is required.@Stability(value=Experimental) @NotNull public IIntermediateType addType(@NotNull IIntermediateType type)
type - the intermediate type to add to the schema. This parameter is required.@Stability(value=Experimental) @NotNull public CfnGraphQLSchema bind(@NotNull GraphqlApi api)
api - The binding GraphQL Api. This parameter is required.@Stability(value=Experimental) @NotNull public String getDefinition()
@Stability(value=Experimental)
public void setDefinition(@NotNull
String value)
Copyright © 2022. All rights reserved.