Created
April 23, 2024 14:28
-
-
Save potatosalad/70c5c5aef56a16154a0ee771fe0df778 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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