sid88in / serverless-appsync-plugin

serverless plugin for appsync
MIT License
950 stars 186 forks source link

Subscription Type Error #603

Closed ShariqAteeq closed 1 year ago

ShariqAteeq commented 1 year ago

`type Subscription { onNotified(userId: ID!, type: NotificationType): Notifications @aws_subscribe( mutations: [ "notifyDMed"

"notifyRetweeted"

    # "notifyLiked"
    # "notifyMentioned"
    # "notifyReplied"
    "notifyOrgConnected"
    "notifyOrgAccEvent"
    "notifyVolJoinEvent"
    "notifyVolJoinOrg"
    "notifyOrgForEvent"
    "notifyOrgForMembr"
    "notifyOrgForEventInvt"
    "notifyOrgVolForEvnt"
    "notifyVolForComment"
    "notifyPartForEvntUpdte"
    "notifyConvo"
    "notifyUpdatedConvo"
    "notifyForSubsOrg"
  ]
)
@aws_cognito_user_pools

}`

Request Mapping Template { "version": "2018-05-29", "payload": $util.toJson($context.arguments) }

Response Mapping Template {$util.toJson($context.result)}

Error Message: "Connection failed: {\"errors\":[{\"message\":\"Can't resolve '/onNotified'. Abstract type 'Notifications' must resolve to an Object type at runtime for field 'Subscription.onNotified'. Could not determine the exact type of Notifications. Missing __typename key on value.'\"}]}"

bboure commented 1 year ago

Hi @ShariqAteeq

Please note that this repository refers to the AppSync plugin for thee serverless framework. You question seems to be about AppSync in general (not this plugin). You might have a better chance asking this somewhere else, for example here

However, I'll try to answer your question.

I am missing some context here, but he error seems to say that Notifications is not a valid return type for a subscription. It looks like it's not an object. You did not share the full schema, so I can't really tell what is wrong with it, sorry.