Relay: Unable to use @deleteRecord on field of type ID!

Created on 22 Jul 2020  路  3Comments  路  Source: facebook/relay

When I try to do the following mutation:

const deleteMutation = graphql`
  mutation EventSettingsDeleteMutation($input: DeleteEventInput!) {
    deleteEvent(input: $input) {
      deletedEventId @deleteRecord
    }
  }
`;

For the scheme:

type DeleteEventPayload {
    deletedEventId: ID!
}

I get following when running relay-compiler:

ERROR:
Invalid use of @deleteRecord on field 'deletedEventId'. Expected field type ID, got ID!.

Source: js/Manager/Events/Event/EventSettings.tsx (4:22)
3:     deleteEvent(input: $input) {
4:       deletedEventId @deleteRecord
                        ^
5:     }

Is this intended?

wontfix

Most helpful comment

I've added a fix for this in a related PR for @deleteRecord: https://github.com/facebook/relay/pull/3135

All 3 comments

That sounds like a bug, cc @tyao1

I've added a fix for this in a related PR for @deleteRecord: https://github.com/facebook/relay/pull/3135

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings