{ : } type BookResult book id Query ID! { ( : ): } type Book ReservedBook BookNotFound BookResult = | | union ID String String id title author Book { : : : } type ID String String User id title author reservedBy ReservedBook { : : : : } type
: { : { : , : } } } on on on Book ReservedBook BookNotFound 3 book id __typename id title author id title author reservedBy username message { ( : ) { ... { } ... { { } } ... { } } }
a especificação GraphQL não discute qualquer estratégia específica de implementação de diretivas, cabe a cada estrutura de servidor GraphQL expor uma API para implementação de novas diretivas.
"data" { : { : { : , : , : } } } on on on Book ReservedBook Error 2 book id __typename id title author id title author reservedBy username errorMessage type { ( : ) { ... { } ... { { } } ... { } } }