Take for example the following GraphQL schema:

```graphql
type Post @model @auth(rules: [{ allow: public, provider: apiKey }]){
  id: ID!
  title: String!
  content: String
  comments: [Comment] @hasMany
}

type Comment @model @auth(rules: [{ allow: public, provider: apiKey }]){
  id: ID!
  content: String
}
```

By default, subscriptions will be created for the following mutations:

```graphql
# Post type
onCreatePost
onUpdatePost
onDeletePost

# Comment type
onCreateComment
onUpdateComment
onDeleteComment
```

One operation that is not covered is if you wanted to only subscribe to comments for a specific post.

Because the schema has a one to many relationship enabled between posts and comments, you can use the auto-generated field `postCommentsId` that defines the relationship between the post and the comment to set this up in a new Subscription definition.

To implement this, you could update the schema with the following:

```graphql
type Post @model @auth(rules: [{ allow: public, provider: apiKey }]){
  id: ID!
  title: String!
  content: String
  comments: [Comment] @hasMany
}

type Comment @model @auth(rules: [{ allow: public, provider: apiKey }]){
  id: ID!
  content: String
  postCommentsId: ID!
}

type Subscription {
  onCommentByPostId(postCommentsId: ID!): Comment
    @aws_subscribe(mutations: ["createComment"])
}

```

Now you can create a custom subscription for comment creation with a specific post id:
