-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Description
https://docs.aws.amazon.com/appsync/latest/devguide/real-time-data.html
Is there any way to implement the @aws_subscribe?
For example,
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
printSchema,
GraphQLFieldConfig
} from 'graphql';
export function handler() {
const schema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
fields: {
hello: {
type: GraphQLString,
resolve() {
return 'world';
}
}
}
}),
subscription: new GraphQLObjectType({
name: 'Subscription',
fields: {
subscription:<GraphQLFieldConfig<any, any>> {
type: GraphQLString,
resolve() {
return 'world';
}
}
}
})
});
const x = printSchema(schema);
console.log(x);
}
will output
type Query {
hello: String
}
type Subscription {
subscription: String
}
How can I make it like
type Query {
hello: String
}
type Subscription {
subscription: String
@aws_subscribe(mutations: ["addPost"])
}
Thank you.