Derive Macro RelayInterface

Source
#[derive(RelayInterface)]
Expand description

The RelayInterface macro is applied to a GraphQL Interface enum to allow it to be used for Relay’s node query. This enum should contain all types that that exist in your GraphQL schema to work as designed in the Relay server specification.

#[derive(Interface, RelayInterface)] // See the 'RelayInterface' derive macro
#[graphql(field(name = "id", type = "NodeGlobalID"))] // The 'RelayInterface' macro generates a type called '{enum_name}GlobalID' which should be used like this to facilitate using the async_graphql_relay::RelayNodeID for globally unique ID's
pub enum Node {
    User(User),
    Tenant(Tenant),
   // Put all of your Object's in this enum
}