Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS AppSync - Defining GraphQL schema with custom directives

While defining this custom directive:

directive @hashField on INPUT_FIELD_DEFINITION

I get this error on the AWS AppSync (Schema tab):

Error parsing schema. Directive definitions are not supported.

I understand AWS provides functions that can provide similar functionalities, but these functions won't work for my use case.

What's the alternative for custom directives in AWS AppSync? Is it going to be supported in a future release?

like image 311
Cacho Santa Avatar asked Feb 03 '20 23:02

Cacho Santa


People also ask

What is a GraphQL directive?

A directive decorates part of a GraphQL schema or operation with additional configuration. Tools like Apollo Server (and Apollo Client) can read a GraphQL document's directives and perform custom logic as appropriate. Directives are preceded by the @ character, like so: GraphQL. schema.graphql.

Is AppSync a GraphQL?

AWS AppSync provides a robust, scalable GraphQL interface for application developers to combine data from multiple sources, including Amazon DynamoDB, AWS Lambda, and HTTP APIs.

What is AWSTimestamp?

AWSTimestamp. An integer value representing the number of seconds before or after 1970-01-01-T00:00Z . AWSEmail. An email address in the format local-part@domain-part as defined by RFC 822 .


1 Answers

Apparently it's not in their roadmap to add Directives support.

An alternative could be custom scalar types; however, it doesn't meet my requirements since I need to specify order of multiple directives applied to a particular field.

like image 60
Cacho Santa Avatar answered Oct 22 '22 12:10

Cacho Santa