Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save potatosalad/70c5c5aef56a16154a0ee771fe0df778 to your computer and use it in GitHub Desktop.
Save potatosalad/70c5c5aef56a16154a0ee771fe0df778 to your computer and use it in GitHub Desktop.
SD = argo_graphql_service_document:from_string(
"type Query {\n"
" hero: Character\n"
"}\n"
"interface Character { id: ID! }\n"
"type Droid implements Character {\n"
" id: ID!\n"
" properties: DroidProperties!\n"
"}\n"
"type DroidProperties {\n"
" x: Int!\n"
" y: String!\n"
"}\n"
"type Human implements Character {\n"
" id: ID!\n"
" properties: HumanProperties!\n"
"}\n"
"type HumanProperties {\n"
" x: Int!\n"
" z: String!\n"
"}\n"
),
ED = argo_graphql_executable_document:from_string(
"query {\n"
" hero {\n"
" ... on Droid {\n"
" id\n"
" properties {\n"
" x\n"
" y\n"
" }\n"
" }\n"
" }\n"
"}\n"
),
{_, WT} = argo_typer:derive_wire_type(SD, ED, none),
argo:display(WT).
% {
% data: {
% hero: {
% id?: STRING<ID>
% properties?: {
% x: VARINT{Int}
% y: STRING<String>
% }
% }?
% }?
% errors?: ERROR[]
% extensions?: EXTENSIONS
% }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment