graphql
A GraphQL server: schemas, resolvers, query execution and HTTP handling.
import graphql
GraphQL is a language for asking an API for data: the client asks for exactly the fields it needs and the server sends back just those. This package is a complete server side implementation of the specification. Write the schema as SDL text and pass it to ParseSchema, or build it with the Add... functions, register resolvers for the fields and run a query with ExecuteSource.
A resolver is a function that takes a slot number; it reads the arguments and the parent object with ArgStr, ParentField and their siblings, and answers with one of the Resolve... functions or with Fail. A field without a resolver takes the value of the same name from the parent object. For a web server, call HandleHttpSimple inside a net/http handler.
Types
GqlHttpRequest
struct GqlHttpRequest| Name | Type | Description |
|---|---|---|
query | str = "" | The query text. |
operationName | str = "" | The operation name. |
variables | value.Value | The variables. |
extensions | value.Value | The extensions. |
ok | bool = true | It was read correctly. |
error | str = "" | If not, the reason. |
import graphql
import encoding.value
import net.http
import net.router
mut schema := graphql.NewSchema()
func me(slot: i64):
ctx := graphql.Context(slot)
mut name := "guest"
if value.ObjectHas(ctx, "user"):
name = value.AsString(value.ObjectGet(ctx, "user"))
end
graphql.ResolveStr(slot, name + " (" + graphql.ParentTypeName(slot) + "." + graphql.FieldName(slot) + ")")
end
func add(slot: i64):
graphql.ResolveInt(slot, graphql.ArgInt(slot, "a") + graphql.ArgInt(slot, "b"))
end
func endpoint(ctx: i64):
res := graphql.HandleHttpSimple(schema, http.Ctx_method(ctx), http.Ctx_header(ctx, "Content-Type"), http.Ctx_body(ctx), http.Ctx_raw_query(ctx))
http.Ctx_status(ctx, res.status)
http.Ctx_set_header(ctx, "Content-Type", res.contentType)
http.Ctx_text(ctx, res.body)
end
func main:
mut err := graphql.NewError(graphql.ERR_SYNTAX, "")
graphql.ParseSchemaInto(schema, "type Query { me: String! add(a: Int!, b: Int!): Int! }", err)
_ := graphql.SetResolver(schema, "Query", "me", me)
_ := graphql.SetResolver(schema, "Query", "add", add)
mut r := router.NewRouter()
router.Post(r, "/graphql", endpoint)
router.Get(r, "/graphql", endpoint)
mut srv := http.NewServer(19640)
http.Use(srv, r)
_ := http.RunBackground(srv)
mut vars := value.NewValueObject()
value.ObjectSet(vars, "x", value.ValueInt(40))
body := graphql.BuildRequestBody("query Sum($x: Int!) { add(a: $x, b: 2) }", "Sum", vars)
println body
mut headers := http.NewHeaders()
headers.insert("Content-Type", "application/json")
resp := http.PostWith("http://127.0.0.1:19640/graphql", body, headers)
println http.Status(resp), http.Body(resp)
mut cr := graphql.ParseResponse(http.Body(resp))
println graphql.ResponseOk(cr), cr.hasData, value.AsInt(graphql.ResponseField(cr, "add"))
graphql.FreeClientResponse(cr)
qs := graphql.BuildRequestQueryString("{ me }", "", value.ValueNull())
resp2 := http.Get("http://127.0.0.1:19640/graphql?" + qs)
println http.Body(resp2)
resp3 := http.PostWith("http://127.0.0.1:19640/graphql", graphql.BuildQueryBody("{ nope }"), headers)
mut cr3 := graphql.ParseResponse(http.Body(resp3))
println http.Status(resp3), graphql.ResponseOk(cr3), graphql.ResponseErrorMessage(cr3)
graphql.FreeClientResponse(cr3)
mut req := graphql.ParseHttpRequestJSON(`{"query":"{ me }"}`)
mut context := value.NewValueObject()
value.ObjectSet(context, "user", value.ValueString("Maryam"))
mut res := graphql.HandleRequest(schema, req, value.ValueNull(), context)
println graphql.ResultToJSON(res)
graphql.FreeResult(res)
graphql.FreeHttpRequest(req)
bad := graphql.ParseHttpRequest("PUT", "application/json", "{}", "")
println bad.ok, bad.error
resp4 := graphql.HandleHttp(schema, "POST", "application/json", "not json", "", value.ValueNull(), value.ValueNull())
println resp4.status
endGqlHttpResponse
struct GqlHttpResponse| Name | Type | Description |
|---|---|---|
status | int = 200 | The status code. |
contentType | str = "application/json" | The content type. |
body | str = "" | The body. |
The example for this item is shown with the ones above: graphql-Http.salam
GqlError
struct GqlError| Name | Type | Description |
|---|---|---|
category | int | The category. |
message | str = "" | The message. |
line | int = 0 | The line. |
col | int = 0 | The column. |
hasLocation | bool = false | It has a location. |
pathKeys | Vector | The keys of the path in the response. |
pathIndex | Vector | The indexes of the path; -1 for a key. |
code | str = "" | An optional code in extensions. |
import graphql
import encoding.value
func main:
source := `query Books($limit: Int = 5) { books(limit: $limit, tags: ["a", "b"]) @include(if: true) { ...Info alias: title } }
fragment Info on Book { id year }`
println graphql.ParseOk(source), graphql.ParseOk("{ a "), graphql.LexOk("{ a }")
mut err := graphql.NewError(graphql.ERR_SYNTAX, "")
mut doc := graphql.Parse(source, err)
println doc.ops.len(), doc.frags.len()
print graphql.Print(doc)
i := graphql.FindOperation(doc, "Books")
op := doc.ops.get(i)
println op.name, graphql.OperationTypeName(op.optype), op.shorthand, op.varDefs.len(), op.line
sel := graphql.SelectionAt(doc, op.selections.get(0))
println sel.kind == graphql.SEL_FIELD, sel.name, graphql.ResponseKey(sel), sel.args.len(), sel.directives.len(), sel.selections.len(), sel.line, sel.col
arg := sel.args.get(1)
println arg.name, graphql.PrintValue(doc, arg.value), graphql.ValueAt(doc, arg.value).kind == graphql.VAL_LIST
vdef := op.varDefs.get(0)
println vdef.name, graphql.PrintTypeRef(doc, vdef.typeRef), graphql.TypeRefName(doc, vdef.typeRef)
println graphql.TypeRefIsNonNull(doc, vdef.typeRef), graphql.TypeRefIsList(doc, vdef.typeRef), graphql.TypeRefAt(doc, vdef.typeRef).name
frag := doc.frags.get(graphql.FindFragment(doc, "Info"))
println frag.name, frag.typeCondition, frag.selections.len()
println graphql.PrintStringValue("hello \"world\"")
graphql.FreeDocument(doc)
mut ok := false
stream := graphql.Tokenize(`{ a(x: 1.5, y: "s") }`, ok)
println ok, stream.toks.len()
tok := stream.toks.get(5)
println graphql.TokenKindName(tok.kind), tok.lexeme, tok.fval, tok.line, tok.col
println graphql.IsStringToken(graphql.TOK_STRING), graphql.TokenKindName(graphql.TOK_LBRACE)
_ := graphql.Parse("{ a(", err)
println err.category == graphql.ERR_SYNTAX, err.line, err.col, err.hasLocation
println graphql.ErrorString(err)
mut e := graphql.NewError(graphql.ERR_EXECUTION, "failed")
graphql.PathPushKey(e, "books")
graphql.PathPushIndex(e, 2)
graphql.PathPushKey(e, "title")
println graphql.PathLen(e), graphql.PathString(e)
mut errs := graphql.GqlErrorList {}
graphql.AddError(errs, e)
graphql.AddError(errs, graphql.NewErrorAt(graphql.ERR_VALIDATION, "bad", 3, 7))
graphql.AddError(errs, graphql.SyntaxError("unclosed parenthesis", 1, 4))
println graphql.HasErrors(errs), graphql.ErrorCount(errs), graphql.ErrorAt(errs, 1).line
println value.ArrayLen(graphql.ErrorsToValue(errs)), value.IsObject(graphql.ErrorToValue(e))
graphql.FreeError(err)
graphql.FreeErrorList(errs)
println graphql.ERR_REQUEST, graphql.SpecEdition
mut s := graphql.ParseSchema("type Query { n(x: Int!): Int e: Color } enum Color { RED }", err)
println graphql.ValidateSource(s, "{ n(x: \"a\") }").items.len() > 0
mut doc2 := graphql.Parse("{ n(x: 1) e }", err)
println graphql.ValidateOk(s, doc2), graphql.Validate(s, doc2).items.len()
c := graphql.CoerceLeafResult(s, "Color", value.ValueString("RED"))
println c.ok, value.AsString(c.value)
c2 := graphql.CoerceLeafResult(s, "Int", value.ValueString("x"))
println c2.ok, c2.message.len() > 0
graphql.FreeDocument(doc2)
graphql.FreeSchema(s)
endGqlErrorList
struct GqlErrorList| Name | Type | Description |
|---|---|---|
items | Vector | The errors. |
The example for this item is shown with the ones above: graphql-Document.salam
Vx
struct Vx| Name | Type | Description |
|---|---|---|
sch | Schema | The schema. |
doc | Document | The document. |
errors | GqlErrorList | The errors. |
usedFragments | Vector | The fragments that were used. |
usedVars | Vector | The variables that were used. |
The example for this item is shown with the ones above: graphql-Document.salam
FieldGroup
struct FieldGroup| Name | Type | Description |
|---|---|---|
key | str = "" | The key. |
sels | Vector | The selections. |
import graphql
import encoding.value
func book(id: str, title: str, year: i64): value.Value:
mut b := value.NewValueObject()
value.ObjectSet(b, "id", value.ValueString(id))
value.ObjectSet(b, "title", value.ValueString(title))
value.ObjectSet(b, "year", value.ValueInt(year))
ret b
end
func hello(slot: i64):
graphql.ResolveStr(slot, "Hello " + graphql.ArgStr(slot, "name"))
end
func books(slot: i64):
mut list := value.NewValueArray()
value.ArrayPush(list, book("1", "The Blind Owl", 1936))
value.ArrayPush(list, book("2", "Savushun", 1969))
graphql.Resolve(slot, list)
end
func one_book(slot: i64):
if graphql.ArgInt(slot, "id") == 2:
graphql.Resolve(slot, book("2", "Savushun", 1969))
else:
graphql.ResolveNull(slot)
end
end
func age(slot: i64):
year := value.AsInt(graphql.ParentField(slot, "year"))
graphql.ResolveInt(slot, 2026 - year)
end
func score(slot: i64):
graphql.ResolveFloat(slot, graphql.ArgFloat(slot, "base") * 2.0)
end
func in_stock(slot: i64):
graphql.ResolveBool(slot, graphql.ArgBool(slot, "only") or graphql.HasArg(slot, "x"))
end
func broken(slot: i64):
graphql.Fail(slot, "service unavailable")
end
func main:
mut err := graphql.NewError(graphql.ERR_SYNTAX, "")
mut s := graphql.ParseSchema(`
type Query {
hello(name: String = "world"): String!
books: [Book!]!
book(id: Int!): Book
score(base: Float!): Float!
inStock(only: Boolean!): Boolean!
broken: String
}
type Book {
id: ID!
title: String!
year: Int!
age: Int!
}`, err)
_ := graphql.SetResolver(s, "Query", "hello", hello)
_ := graphql.SetResolver(s, "Query", "books", books)
_ := graphql.SetResolver(s, "Query", "book", one_book)
_ := graphql.SetResolver(s, "Query", "score", score)
_ := graphql.SetResolver(s, "Query", "inStock", in_stock)
_ := graphql.SetResolver(s, "Query", "broken", broken)
_ := graphql.SetResolver(s, "Book", "age", age)
println graphql.HasResolver(s, "Book", "age"), graphql.HasResolver(s, "Book", "title")
mut r := graphql.Run(s, `{ hello books { title year age } }`)
println graphql.ResultOk(r)
println graphql.ResultToJSONStable(r)
graphql.FreeResult(r)
mut vars := value.NewValueObject()
value.ObjectSet(vars, "id", value.ValueInt(2))
mut r2 := graphql.ExecuteSource(s, `query One($id: Int!) { book(id: $id) { title } missing: book(id: 9) { title } score(base: 1.5) inStock(only: true) hello(name: "Maryam") }`, "One", vars, value.ValueNull(), value.ValueNull())
println graphql.ResultToJSONStable(r2)
graphql.FreeResult(r2)
mut r3 := graphql.Run(s, `{ broken hello }`)
println graphql.ResultOk(r3), graphql.ResultErrorMessage(r3)
println graphql.ResultToJSONStable(r3)
graphql.FreeResult(r3)
mut r4 := graphql.Run(s, `{ nope }`)
println graphql.ResultErrorMessage(r4)
graphql.FreeResult(r4)
graphql.ResetSlots()
graphql.FreeSchema(s)
endFieldGroups
struct FieldGroups| Name | Type | Description |
|---|---|---|
items | Vector | The groups. |
import graphql
import encoding.value
import encoding.json
func names(slot: i64):
graphql.ResolveStr(slot, json.EncodeDefault(graphql.Args(slot)))
end
func main:
mut ok := false
stream := graphql.Tokenize(`query Q($v: [Int!]! = [1]) @x { ...F a: b(c: 2.5, d: """text""") | & ? }`, ok)
mut kinds := ""
each t in stream.toks:
if kinds.len() > 0:
kinds += " "
end
kinds += graphql.TokenKindName(t.kind)
end
println ok, kinds
println graphql.TOK_EOF, graphql.TOK_NAME, graphql.TOK_INT, graphql.TOK_FLOAT, graphql.TOK_BLOCK_STRING, graphql.TOK_BANG, graphql.TOK_DOLLAR
println graphql.TOK_AMP, graphql.TOK_LPAREN, graphql.TOK_RPAREN, graphql.TOK_SPREAD, graphql.TOK_COLON, graphql.TOK_EQUALS, graphql.TOK_AT
println graphql.TOK_LBRACKET, graphql.TOK_RBRACKET, graphql.TOK_RBRACE, graphql.TOK_PIPE, graphql.TOK_ERROR
mut err := graphql.NewError(graphql.ERR_SYNTAX, "")
mut s := graphql.ParseSchema(`
type Query { names(a: Boolean, b: Float, o: In, v: Int): String! book: Book }
input In { x: Int! }
type Book { id: ID! title: String! }`, err)
_ := graphql.SetResolver(s, "Query", "names", names)
mut doc := graphql.Parse(`query ($v: Int, $l: [Int!]) { names(a: true, b: 1.5, o: { x: 3 }, v: $v) book { id ...F ... on Book { title } } }
fragment F on Book { title }`, err)
op := doc.ops.get(0)
println op.optype == graphql.OP_QUERY
sel := graphql.SelectionAt(doc, op.selections.get(0))
mut vars := value.NewValueObject()
value.ObjectSet(vars, "v", value.ValueInt(42))
each a in sel.args:
v := graphql.ValueAt(doc, a.value)
lit := graphql.LiteralToValue(s, doc, a.value, vars)
println a.name, v.kind == graphql.VAL_BOOL, v.kind == graphql.VAL_FLOAT, v.kind == graphql.VAL_OBJECT, v.kind == graphql.VAL_VARIABLE, lit.ok, json.EncodeDefault(lit.value)
end
lref := op.varDefs.get(1).typeRef
elem := graphql.TypeRefElement(doc, lref)
println graphql.PrintTypeRef(doc, lref), graphql.PrintTypeRef(doc, elem), graphql.TypeRefAt(doc, elem).kind == graphql.TREF_NAMED
mut list := value.NewValueArray()
value.ArrayPush(list, value.ValueInt(1))
value.ArrayPush(list, value.ValueString("two"))
c := graphql.CoerceInput(s, doc, lref, list)
println c.ok, c.message.len() > 0
bk := graphql.SelectionAt(doc, op.selections.get(1))
println graphql.SelectionAt(doc, bk.selections.get(1)).kind == graphql.SEL_FRAGMENT_SPREAD, graphql.SelectionAt(doc, bk.selections.get(2)).kind == graphql.SEL_INLINE_FRAGMENT
mut groups := graphql.CollectFields(s, doc, bk.selections, "Book", vars)
each g in groups.items:
println g.key, g.sels.len(), graphql.MergeSelections(doc, g).len()
end
graphql.FreeFieldGroups(groups)
mut r := graphql.Execute(s, doc, "", vars, value.ValueNull(), value.ValueNull())
mut ext := value.NewValueObject()
value.ObjectSet(ext, "ms", value.ValueInt(3))
graphql.SetExtensions(r, ext)
println value.IsObject(graphql.ResultToValue(r))
println graphql.ResultToJSONIndent(r)
graphql.FreeResult(r)
graphql.FreeDocument(doc)
graphql.FreeSchema(s)
graphql.FreeError(err)
endCoerceResult
struct CoerceResult| Name | Type | Description |
|---|---|---|
ok | bool = true | The conversion worked. |
message | str = "" | The error message. |
value | value.Value | The value. |
The example for this item is shown with the ones above: graphql-Document.salam
AstValue
struct AstValue| Name | Type | Description |
|---|---|---|
kind | int | The kind, one of the VAL_... constants. |
b | bool = false | The boolean value. |
i | i64 = 0 | The integer value. |
f | f64 = 0 | The float value. |
s | str = "" | The string, the enum name or the variable name. |
items | Vector | The list elements or the object values. |
keys | Vector | The object keys. |
line | int = 0 | The line. |
The example for this item is shown with the ones above: graphql-Document.salam
AstTypeRef
struct AstTypeRef| Name | Type | Description |
|---|---|---|
kind | int | Named or list. |
name | str = "" | The type name. |
inner | int = -1 | The inner reference of a list. |
nonNull | bool = false | Non null, with a !. |
import graphql
func main:
mut s := graphql.NewSchema()
graphql.AddScalarType(s, "Date", "A date as YYYY-MM-DD")
graphql.AddInterfaceType(s, "Node", "")
_ := graphql.AddField(s, "Node", "id", "ID!")
graphql.AddObjectType(s, "Author", "An author")
graphql.AddInterfaceTo(s, "Author", "Node")
_ := graphql.AddField(s, "Author", "id", "ID!")
_ := graphql.AddField(s, "Author", "name", "String!")
_ := graphql.AddField(s, "Author", "born", "Date")
mut genres := Vector {} as Vector<str>
genres.push("NOVEL")
genres.push("POETRY")
graphql.AddEnumType(s, "Genre", genres)
mut members := Vector {} as Vector<str>
members.push("Author")
graphql.AddUnionType(s, "SearchResult", members)
graphql.AddInputObjectType(s, "AuthorInput", "")
_ := graphql.AddInputField(s, "AuthorInput", "name", "String!")
graphql.AddObjectType(s, "Query", "")
_ := graphql.AddField(s, "Query", "authors", "[Author!]!")
_ := graphql.AddField(s, "Query", "search", "[SearchResult!]!")
_ := graphql.AddFieldArg(s, "Query", "search", "text", "String!")
_ := graphql.AddFieldArg(s, "Query", "search", "genre", "Genre")
graphql.AddObjectType(s, "Mutation", "")
_ := graphql.AddField(s, "Mutation", "addAuthor", "Author!")
_ := graphql.AddFieldArg(s, "Mutation", "addAuthor", "input", "AuthorInput!")
graphql.SetRootTypes(s, "Query", "Mutation", "")
print graphql.PrintSchema(s)
println "---"
println graphql.PrintType(s, "Genre")
println graphql.HasType(s, "Author"), graphql.TypeIndex(s, "Author") >= 0, graphql.TypeCount(s) > 5
t := graphql.FindType(s, "Author")
println t.name, t.kind == graphql.TYPE_OBJECT, t.description, graphql.HasField(t, "born")
f := graphql.FindField(graphql.FindType(s, "Query"), "search")
println f.name, graphql.FindArg(f, "genre").name, graphql.FindArg(f, "genre").hasDefault
println graphql.FindInputField(graphql.FindType(s, "AuthorInput"), "name").name
println graphql.HasEnumValue(graphql.FindType(s, "Genre"), "POETRY")
println graphql.IsInputType(s, "AuthorInput"), graphql.IsOutputType(s, "AuthorInput"), graphql.IsLeafType(s, "Genre")
println graphql.IsAbstractType(s, "SearchResult"), graphql.IsPossibleType(s, "Node", "Author"), graphql.PossibleTypes(s, "Node").len()
println graphql.RootTypeName(s, graphql.OP_MUTATION), graphql.RootTypeName(s, graphql.OP_SUBSCRIPTION).len()
println graphql.FindDirectiveDef(s, "deprecated").name
println graphql.TypeAt(s, 0).name.len() > 0
println graphql.IsIntrospectionType("__Schema"), graphql.IsIntrospectionType("Author")
graphql.AddIntrospectionTypes(s)
println graphql.HasType(s, "__Type"), graphql.PrintSchemaFull(s).len() > graphql.PrintSchema(s).len()
println graphql.TypeRefText(s, "[Int!]") >= 0
println graphql.ParseSchemaOk("type Query { a: Int }"), graphql.ParseSchemaOk("type {")
mut err := graphql.NewError(graphql.ERR_SYNTAX, "")
graphql.ParseSchemaInto(s, "extend type Author { alias: String }", err)
println graphql.HasField(graphql.FindType(s, "Author"), "alias"), err.message.len()
println graphql.TYPE_SCALAR, graphql.TYPE_INTERFACE, graphql.TYPE_UNION, graphql.TYPE_ENUM, graphql.TYPE_INPUT_OBJECT
graphql.FreeSchema(s)
endAstArgument
struct AstArgument| Name | Type | Description |
|---|---|---|
name | str = "" | The name. |
value | int = -1 | The number of the value. |
line | int = 0 | The line. |
The example for this item is shown with the ones above: graphql-Document.salam
AstDirective
struct AstDirective@include.| Name | Type | Description |
|---|---|---|
name | str = "" | The name. |
args | Vector | The arguments. |
line | int = 0 | The line. |
The example for this item is shown with the ones above: graphql-Document.salam
AstSelection
struct AstSelection| Name | Type | Description |
|---|---|---|
kind | int | The kind, one of the SEL_... constants. |
name | str = "" | The name of the field or fragment. |
alias | str = "" | Another name for the field in the response. |
typeCondition | str = "" | The type of an inline fragment. |
hasTypeCondition | bool = false | It has a type. |
args | Vector | The arguments. |
directives | Vector | The directives. |
selections | Vector | The sub selections. |
line | int = 0 | The line. |
col | int = 0 | The column. |
The example for this item is shown with the ones above: graphql-Document.salam
AstVariableDef
struct AstVariableDef| Name | Type | Description |
|---|---|---|
name | str = "" | The name without the $. |
typeRef | int = -1 | The type reference. |
defaultValue | int = -1 | The number of the default value. |
hasDefault | bool = false | It has a default. |
directives | Vector | The directives. |
line | int = 0 | The line. |
The example for this item is shown with the ones above: graphql-Document.salam
AstOperation
struct AstOperation| Name | Type | Description |
|---|---|---|
optype | int | The type, one of the OP_... constants. |
name | str = "" | The name; empty for a shorthand query. |
varDefs | Vector | The variable definitions. |
directives | Vector | The directives. |
selections | Vector | The numbers of the root selections. |
shorthand | bool = false | It was written in the short { ... } form. |
line | int = 0 | The line. |
The example for this item is shown with the ones above: graphql-Document.salam
AstFragment
struct AstFragment| Name | Type | Description |
|---|---|---|
name | str = "" | The name. |
typeCondition | str = "" | The type the fragment applies to. |
directives | Vector | The directives. |
selections | Vector | The selections. |
line | int = 0 | The line. |
The example for this item is shown with the ones above: graphql-Document.salam
Document
struct Document| Name | Type | Description |
|---|---|---|
ops | Vector | The operations. |
frags | Vector | The fragments. |
sels | Vector | The selections. |
vals | Vector | The values. |
trefs | Vector | The type references. |
The example for this item is shown with the ones above: graphql-Document.salam
ResolverSlot
struct ResolverSlot| Name | Type | Description |
|---|---|---|
busy | bool = false | In use. |
parent | value.Value | The parent. |
args | value.Value | The arguments. |
ctx | value.Value | The context. |
fieldName | str = "" | The field name. |
parentType | str = "" | The parent type. |
result | value.Value | The result. |
resolved | bool = false | The result was set. |
failed | bool = false | It failed. |
message | str = "" | The error message. |
The example for this item is shown with the ones above: graphql-Execute.salam
GqlSlotTable
struct GqlSlotTable| Name | Type | Description |
|---|---|---|
items | Vector | The slots. |
The example for this item is shown with the ones above: graphql-Execute.salam
Ex
struct Ex| Name | Type | Description |
|---|---|---|
sch | Schema | The schema. |
doc | Document | The document. |
vars | value.Value | The variables. |
ctx | value.Value | The context. |
errors | GqlErrorList | The errors. |
pathKeys | Vector | The current path. |
pathIdx | Vector | The indexes of the path. |
depth | int = 0 | The depth. |
maxDepth | int = 512 | The greatest depth allowed. |
The example for this item is shown with the ones above: graphql-Execute.salam
ClientResponse
struct ClientResponse| Name | Type | Description |
|---|---|---|
data | value.Value | The data. |
hasData | bool = false | It has data. |
errors | GqlErrorList | The errors. |
extensions | value.Value | The extensions. |
hasExtensions | bool = false | It has extensions. |
The example for this item is shown with the ones above: graphql-Http.salam
GqlToken
struct GqlToken| Name | Type | Description |
|---|---|---|
kind | int | The kind, one of the TOK_... constants. |
lexeme | str = "" | The text. |
sval | str = "" | The string value. |
ival | i64 = 0 | The integer value. |
fval | f64 = 0 | The float value. |
line | int = 0 | The line. |
col | int = 0 | The column. |
pos | int = 0 | Where it starts in the text. |
The example for this item is shown with the ones above: graphql-Document.salam
GqlTokenStream
struct GqlTokenStream| Name | Type | Description |
|---|---|---|
toks | Vector | The tokens. |
The example for this item is shown with the ones above: graphql-Document.salam
ExecutionResult
struct ExecutionResult| Name | Type | Description |
|---|---|---|
data | value.Value | The data. |
hasData | bool = false | It has data; not when the request never ran at all. |
errors | GqlErrorList | The errors. |
extensions | value.Value | The extensions. |
hasExtensions | bool = false | It has extensions. |
The example for this item is shown with the ones above: graphql-Execute.salam
InputValueDef
struct InputValueDef| Name | Type | Description |
|---|---|---|
name | str = "" | The name. |
description | str = "" | The description. |
typeRef | int = -1 | The type reference. |
defaultValue | int = -1 | The default value in the document. |
hasDefault | bool = false | It has a default value. |
is_deprecated | bool = false | It is deprecated. |
deprecationReason | str = "" | Why it was deprecated. |
The example for this item is shown with the ones above: graphql-Schema.salam
FieldDef
struct FieldDef| Name | Type | Description |
|---|---|---|
name | str = "" | The name. |
description | str = "" | The description. |
typeRef | int = -1 | The type reference. |
args | Vector | The arguments. |
is_deprecated | bool = false | It is deprecated. |
deprecationReason | str = "" | Why it was deprecated. |
resolver | i64 = 0 | The registered resolver. |
The example for this item is shown with the ones above: graphql-Schema.salam
EnumValueDef
struct EnumValueDef| Name | Type | Description |
|---|---|---|
name | str = "" | The name. |
description | str = "" | The description. |
is_deprecated | bool = false | It is deprecated. |
deprecationReason | str = "" | Why it was deprecated. |
The example for this item is shown with the ones above: graphql-Schema.salam
TypeDef
struct TypeDef| Name | Type | Description |
|---|---|---|
kind | int | The kind, one of the TYPE_... constants. |
name | str = "" | The name. |
description | str = "" | The description. |
fields | Vector | The fields, for objects and interfaces. |
inputFields | Vector | The fields of an input type. |
interfaces | Vector | The interfaces it implements. |
unionMembers | Vector | The members of a union. |
enumValues | Vector | The enum values. |
specifiedByURL | str = "" | The specification URL of a scalar type. |
The example for this item is shown with the ones above: graphql-Schema.salam
DirectiveDef
struct DirectiveDef| Name | Type | Description |
|---|---|---|
name | str = "" | The name. |
description | str = "" | The description. |
args | Vector | The arguments. |
locations | Vector | Where it can be used. |
repeatable | bool = false | It may appear more than once in the same place. |
The example for this item is shown with the ones above: graphql-Schema.salam
Schema
struct Schema| Name | Type | Description |
|---|---|---|
doc | Document | The internal document that holds the type references. |
types | Vector | The types. |
directives | Vector | The directives. |
queryType | str = "Query" | The name of the query root type. |
mutationType | str = "" | The name of the mutation root type. |
subscriptionType | str = "" | The name of the subscription root type. |
description | str = "" | The schema description. |
hasSchemaDef | bool = false | It had an explicit schema { ... } block. |
The example for this item is shown with the ones above: graphql-Schema.salam
Constants and variables
SpecEdition
const SpecEdition: str = "October2021"The example for this item is shown with the ones above: graphql-Document.salam
ERR_SYNTAX
const ERR_SYNTAX: i32 = 0The example for this item is shown with the ones above: graphql-Schema.salam
ERR_VALIDATION
const ERR_VALIDATION: i32 = 1The example for this item is shown with the ones above: graphql-Document.salam
ERR_EXECUTION
const ERR_EXECUTION: i32 = 2The example for this item is shown with the ones above: graphql-Document.salam
ERR_REQUEST
const ERR_REQUEST: i32 = 3The example for this item is shown with the ones above: graphql-Document.salam
VAL_NULL
const VAL_NULL: i32 = 0The example for this item is shown with the ones above: graphql-Execute.salam
VAL_BOOL
const VAL_BOOL: i32 = 1The example for this item is shown with the ones above: graphql-Internals.salam
VAL_INT
const VAL_INT: i32 = 2The example for this item is shown with the ones above: graphql-Execute.salam
VAL_FLOAT
const VAL_FLOAT: i32 = 3The example for this item is shown with the ones above: graphql-Internals.salam
VAL_STRING
const VAL_STRING: i32 = 4The example for this item is shown with the ones above: graphql-Execute.salam
VAL_ENUM
const VAL_ENUM: i32 = 5The example for this item is shown with the ones above: graphql-Schema.salam
VAL_LIST
const VAL_LIST: i32 = 6The example for this item is shown with the ones above: graphql-Document.salam
VAL_OBJECT
const VAL_OBJECT: i32 = 7The example for this item is shown with the ones above: graphql-Internals.salam
VAL_VARIABLE
const VAL_VARIABLE: i32 = 8The example for this item is shown with the ones above: graphql-Internals.salam
TREF_NAMED
const TREF_NAMED: i32 = 0The example for this item is shown with the ones above: graphql-Internals.salam
TREF_LIST
const TREF_LIST: i32 = 1The example for this item is shown with the ones above: graphql-Document.salam
SEL_FIELD
const SEL_FIELD: i32 = 0The example for this item is shown with the ones above: graphql-Document.salam
SEL_FRAGMENT_SPREAD
const SEL_FRAGMENT_SPREAD: i32 = 1...Info.The example for this item is shown with the ones above: graphql-Internals.salam
SEL_INLINE_FRAGMENT
const SEL_INLINE_FRAGMENT: i32 = 2... on Book.The example for this item is shown with the ones above: graphql-Internals.salam
OP_QUERY
const OP_QUERY: i32 = 0The example for this item is shown with the ones above: graphql-Internals.salam
OP_MUTATION
const OP_MUTATION: i32 = 1The example for this item is shown with the ones above: graphql-Schema.salam
OP_SUBSCRIPTION
const OP_SUBSCRIPTION: i32 = 2The example for this item is shown with the ones above: graphql-Schema.salam
TOK_EOF
const TOK_EOF: i32 = 0The example for this item is shown with the ones above: graphql-Internals.salam
TOK_NAME
const TOK_NAME: i32 = 1The example for this item is shown with the ones above: graphql-Internals.salam
TOK_INT
const TOK_INT: i32 = 2The example for this item is shown with the ones above: graphql-Internals.salam
TOK_FLOAT
const TOK_FLOAT: i32 = 3The example for this item is shown with the ones above: graphql-Internals.salam
TOK_STRING
const TOK_STRING: i32 = 4The example for this item is shown with the ones above: graphql-Document.salam
TOK_BLOCK_STRING
const TOK_BLOCK_STRING: i32 = 5""" block string.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_BANG
const TOK_BANG: i32 = 6!.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_DOLLAR
const TOK_DOLLAR: i32 = 7$.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_AMP
const TOK_AMP: i32 = 8&.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_LPAREN
const TOK_LPAREN: i32 = 9(.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_RPAREN
const TOK_RPAREN: i32 = 10).The example for this item is shown with the ones above: graphql-Internals.salam
TOK_SPREAD
const TOK_SPREAD: i32 = 11....The example for this item is shown with the ones above: graphql-Internals.salam
TOK_COLON
const TOK_COLON: i32 = 12:.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_EQUALS
const TOK_EQUALS: i32 = 13=.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_AT
const TOK_AT: i32 = 14@.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_LBRACKET
const TOK_LBRACKET: i32 = 15[.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_RBRACKET
const TOK_RBRACKET: i32 = 16].The example for this item is shown with the ones above: graphql-Internals.salam
TOK_LBRACE
const TOK_LBRACE: i32 = 17{.The example for this item is shown with the ones above: graphql-Document.salam
TOK_RBRACE
const TOK_RBRACE: i32 = 18}.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_PIPE
const TOK_PIPE: i32 = 19|.The example for this item is shown with the ones above: graphql-Internals.salam
TOK_ERROR
const TOK_ERROR: i32 = 20The example for this item is shown with the ones above: graphql-Internals.salam
TYPE_SCALAR
const TYPE_SCALAR: i32 = 0The example for this item is shown with the ones above: graphql-Schema.salam
TYPE_OBJECT
const TYPE_OBJECT: i32 = 1The example for this item is shown with the ones above: graphql-Schema.salam
TYPE_INTERFACE
const TYPE_INTERFACE: i32 = 2The example for this item is shown with the ones above: graphql-Schema.salam
TYPE_UNION
const TYPE_UNION: i32 = 3The example for this item is shown with the ones above: graphql-Schema.salam
TYPE_ENUM
const TYPE_ENUM: i32 = 4The example for this item is shown with the ones above: graphql-Schema.salam
TYPE_INPUT_OBJECT
const TYPE_INPUT_OBJECT: i32 = 5The example for this item is shown with the ones above: graphql-Schema.salam
Functions
NewSchema
func NewSchema(): SchemaThe example for this item is shown with the ones above: graphql-Schema.salam
TypeRefText
func TypeRefText(sch &: Schema, text: str): int[Int!], in the schema and returns its number.The example for this item is shown with the ones above: graphql-Schema.salam
AddScalarType
func AddScalarType(sch &: Schema, name: str, description: str)The example for this item is shown with the ones above: graphql-Schema.salam
AddObjectType
func AddObjectType(sch &: Schema, name: str, description: str)The example for this item is shown with the ones above: graphql-Schema.salam
AddInterfaceType
func AddInterfaceType(sch &: Schema, name: str, description: str)The example for this item is shown with the ones above: graphql-Schema.salam
AddInputObjectType
func AddInputObjectType(sch &: Schema, name: str, description: str)The example for this item is shown with the ones above: graphql-Schema.salam
AddEnumType
func AddEnumType(sch &: Schema, name: str, values: Vector<str>)The example for this item is shown with the ones above: graphql-Schema.salam
AddUnionType
func AddUnionType(sch &: Schema, name: str, members: Vector<str>)The example for this item is shown with the ones above: graphql-Schema.salam
AddInterfaceTo
func AddInterfaceTo(sch &: Schema, typeName: str, interfaceName: str)The example for this item is shown with the ones above: graphql-Schema.salam
AddField
func AddField(sch &: Schema, typeName: str, fieldName: str, typeText: str): bool[Book!]!.The example for this item is shown with the ones above: graphql-Schema.salam
AddFieldArg
func AddFieldArg(sch &: Schema, typeName: str, fieldName: str, argName: str, typeText: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
AddInputField
func AddInputField(sch &: Schema, typeName: str, fieldName: str, typeText: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
SetRootTypes
func SetRootTypes(sch &: Schema, queryType: str, mutationType: str, subscriptionType: str)The example for this item is shown with the ones above: graphql-Schema.salam
FreeSchema
func FreeSchema(sch &: Schema)The example for this item is shown with the ones above: graphql-Schema.salam
PrintStringValue
func PrintStringValue(s: str): strThe example for this item is shown with the ones above: graphql-Document.salam
PrintTypeRef
func PrintTypeRef(doc: Document, id: int): strThe example for this item is shown with the ones above: graphql-Document.salam
PrintValue
func PrintValue(doc: Document, id: int): strThe example for this item is shown with the ones above: graphql-Document.salam
Print
func Print(doc: Document): strThe example for this item is shown with the ones above: graphql-Schema.salam
ParseHttpRequest
func ParseHttpRequest(method: str, contentType: str, body: str, queryString: str): GqlHttpRequestapplication/graphql.The example for this item is shown with the ones above: graphql-Http.salam
ParseHttpRequestJSON
func ParseHttpRequestJSON(body: str): GqlHttpRequestThe example for this item is shown with the ones above: graphql-Http.salam
HandleRequest
func HandleRequest(sch: Schema, req: GqlHttpRequest, rootValue: value.Value, ctx: value.Value): ExecutionResultThe example for this item is shown with the ones above: graphql-Http.salam
HandleHttp
func HandleHttp(sch: Schema, method: str, contentType: str, body: str, queryString: str, rootValue: value.Value, ctx: value.Value): GqlHttpResponseThe example for this item is shown with the ones above: graphql-Http.salam
HandleHttpSimple
func HandleHttpSimple(sch: Schema, method: str, contentType: str, body: str, queryString: str): GqlHttpResponseThe example for this item is shown with the ones above: graphql-Http.salam
FreeHttpRequest
func FreeHttpRequest(req &: GqlHttpRequest)The example for this item is shown with the ones above: graphql-Http.salam
NewError
func NewError(category: int, message: str): GqlErrorThe example for this item is shown with the ones above: graphql-Schema.salam
NewErrorAt
func NewErrorAt(category: int, message: str, line: int, col: int): GqlErrorThe example for this item is shown with the ones above: graphql-Document.salam
SyntaxError
func SyntaxError(message: str, line: int, col: int): GqlErrorThe example for this item is shown with the ones above: graphql-Schema.salam
PathPushKey
func PathPushKey(e &: GqlError, key: str)The example for this item is shown with the ones above: graphql-Document.salam
PathPushIndex
func PathPushIndex(e &: GqlError, idx: int)The example for this item is shown with the ones above: graphql-Document.salam
PathLen
func PathLen(e: GqlError): intThe example for this item is shown with the ones above: graphql-Document.salam
PathString
func PathString(e: GqlError): strbooks[2].title.The example for this item is shown with the ones above: graphql-Document.salam
AddError
func AddError(list &: GqlErrorList, e: GqlError)The example for this item is shown with the ones above: graphql-Document.salam
HasErrors
func HasErrors(list: GqlErrorList): boolThe example for this item is shown with the ones above: graphql-Document.salam
ErrorCount
func ErrorCount(list: GqlErrorList): intThe example for this item is shown with the ones above: graphql-Document.salam
ErrorAt
func ErrorAt(list: GqlErrorList, i: int): GqlErrorThe example for this item is shown with the ones above: graphql-Document.salam
ErrorString
func ErrorString(e: GqlError): strThe example for this item is shown with the ones above: graphql-Document.salam
ErrorToValue
func ErrorToValue(e: GqlError): value.ValueThe example for this item is shown with the ones above: graphql-Document.salam
ErrorsToValue
func ErrorsToValue(list: GqlErrorList): value.ValueThe example for this item is shown with the ones above: graphql-Document.salam
FreeError
func FreeError(e &: GqlError)The example for this item is shown with the ones above: graphql-Document.salam
FreeErrorList
func FreeErrorList(list &: GqlErrorList)The example for this item is shown with the ones above: graphql-Document.salam
Parse
func Parse(source: str, err &: GqlError): DocumentThe example for this item is shown with the ones above: graphql-Schema.salam
ParseOk
func ParseOk(source: str): boolThe example for this item is shown with the ones above: graphql-Document.salam
ParseSchema
func ParseSchema(source: str, err &: GqlError): SchemaThe example for this item is shown with the ones above: graphql-Schema.salam
ParseSchemaInto
func ParseSchemaInto(sch &: Schema, source: str, err &: GqlError)extend type included, to an existing schema.The example for this item is shown with the ones above: graphql-Schema.salam
ParseSchemaOk
func ParseSchemaOk(source: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
IsIntrospectionType
func IsIntrospectionType(name: str): bool__Type.The example for this item is shown with the ones above: graphql-Schema.salam
AddIntrospectionTypes
func AddIntrospectionTypes(sch &: Schema)__schema queries work.The example for this item is shown with the ones above: graphql-Schema.salam
Validate
func Validate(sch: Schema, doc: Document): GqlErrorListThe example for this item is shown with the ones above: graphql-Document.salam
ValidateOk
func ValidateOk(sch: Schema, doc: Document): boolThe example for this item is shown with the ones above: graphql-Document.salam
ValidateSource
func ValidateSource(sch: Schema, source: str): GqlErrorListThe example for this item is shown with the ones above: graphql-Document.salam
CollectFields
func CollectFields(sch: Schema, doc: Document, sels: Vector<int>, objectType: str, vars: value.Value): FieldGroupsThe example for this item is shown with the ones above: graphql-Internals.salam
MergeSelections
func MergeSelections(doc: Document, g: FieldGroup): Vector<int>The example for this item is shown with the ones above: graphql-Internals.salam
FreeFieldGroups
func FreeFieldGroups(gs &: FieldGroups)The example for this item is shown with the ones above: graphql-Internals.salam
PrintSchema
func PrintSchema(sch: Schema): strThe example for this item is shown with the ones above: graphql-Schema.salam
PrintSchemaFull
func PrintSchemaFull(sch: Schema): strThe example for this item is shown with the ones above: graphql-Schema.salam
PrintType
func PrintType(sch: Schema, name: str): strThe example for this item is shown with the ones above: graphql-Schema.salam
LiteralToValue
func LiteralToValue(sch: Schema, doc: Document, valueId: int, vars: value.Value): CoerceResultThe example for this item is shown with the ones above: graphql-Internals.salam
CoerceInput
func CoerceInput(sch: Schema, refDoc: Document, typeRef: int, v: value.Value): CoerceResultThe example for this item is shown with the ones above: graphql-Internals.salam
CoerceLeafResult
func CoerceLeafResult(sch: Schema, typeName: str, v: value.Value): CoerceResultThe example for this item is shown with the ones above: graphql-Document.salam
SelectionAt
func SelectionAt(doc: Document, id: int): AstSelectionThe example for this item is shown with the ones above: graphql-Document.salam
ValueAt
func ValueAt(doc: Document, id: int): AstValueThe example for this item is shown with the ones above: graphql-Document.salam
TypeRefAt
func TypeRefAt(doc: Document, id: int): AstTypeRefThe example for this item is shown with the ones above: graphql-Document.salam
FindOperation
func FindOperation(doc: Document, name: str): intThe example for this item is shown with the ones above: graphql-Document.salam
FindFragment
func FindFragment(doc: Document, name: str): intThe example for this item is shown with the ones above: graphql-Document.salam
OperationTypeName
func OperationTypeName(optype: int): strThe example for this item is shown with the ones above: graphql-Document.salam
ResponseKey
func ResponseKey(sel: AstSelection): strThe example for this item is shown with the ones above: graphql-Document.salam
FreeDocument
func FreeDocument(doc &: Document)The example for this item is shown with the ones above: graphql-Document.salam
Tokenize
func Tokenize(source: str, ok &: bool): GqlTokenStreamThe example for this item is shown with the ones above: graphql-Document.salam
LexOk
func LexOk(source: str): boolThe example for this item is shown with the ones above: graphql-Document.salam
BuildRequestBody
func BuildRequestBody(queryText: str, operationName: str, variables: value.Value): strThe example for this item is shown with the ones above: graphql-Http.salam
BuildQueryBody
func BuildQueryBody(queryText: str): strThe example for this item is shown with the ones above: graphql-Http.salam
BuildRequestQueryString
func BuildRequestQueryString(queryText: str, operationName: str, variables: value.Value): strThe example for this item is shown with the ones above: graphql-Http.salam
ParseResponse
func ParseResponse(body: str): ClientResponseThe example for this item is shown with the ones above: graphql-Http.salam
ResponseField
func ResponseField(r: ClientResponse, name: str): value.ValueThe example for this item is shown with the ones above: graphql-Http.salam
ResponseOk
func ResponseOk(r: ClientResponse): boolThe example for this item is shown with the ones above: graphql-Http.salam
ResponseErrorMessage
func ResponseErrorMessage(r: ClientResponse): strThe example for this item is shown with the ones above: graphql-Http.salam
FreeClientResponse
func FreeClientResponse(r &: ClientResponse)The example for this item is shown with the ones above: graphql-Http.salam
SetResolver
func SetResolver(sch &: Schema, typeName: str, fieldName: str, fn: i64): boolThe example for this item is shown with the ones above: graphql-Execute.salam
HasResolver
func HasResolver(sch: Schema, typeName: str, fieldName: str): boolThe example for this item is shown with the ones above: graphql-Execute.salam
Parent
func Parent(slot: i64): value.ValueThe example for this item is shown with the ones above: graphql-Execute.salam
Args
func Args(slot: i64): value.ValueThe example for this item is shown with the ones above: graphql-Internals.salam
Context
func Context(slot: i64): value.ValueThe example for this item is shown with the ones above: graphql-Http.salam
FieldName
func FieldName(slot: i64): strThe example for this item is shown with the ones above: graphql-Http.salam
ParentTypeName
func ParentTypeName(slot: i64): strThe example for this item is shown with the ones above: graphql-Http.salam
HasArg
func HasArg(slot: i64, name: str): boolThe example for this item is shown with the ones above: graphql-Execute.salam
Arg
func Arg(slot: i64, name: str): value.ValueThe example for this item is shown with the ones above: graphql-Schema.salam
ArgInt
func ArgInt(slot: i64, name: str): i64The example for this item is shown with the ones above: graphql-Execute.salam
ArgFloat
func ArgFloat(slot: i64, name: str): f64The example for this item is shown with the ones above: graphql-Execute.salam
ArgStr
func ArgStr(slot: i64, name: str): strThe example for this item is shown with the ones above: graphql-Execute.salam
ArgBool
func ArgBool(slot: i64, name: str): boolThe example for this item is shown with the ones above: graphql-Execute.salam
ParentField
func ParentField(slot: i64, name: str): value.ValueThe example for this item is shown with the ones above: graphql-Execute.salam
Resolve
func Resolve(slot: i64, v: value.Value)The example for this item is shown with the ones above: graphql-Execute.salam
ResolveInt
func ResolveInt(slot: i64, n: i64)The example for this item is shown with the ones above: graphql-Execute.salam
ResolveFloat
func ResolveFloat(slot: i64, f: f64)The example for this item is shown with the ones above: graphql-Execute.salam
ResolveStr
func ResolveStr(slot: i64, s: str)The example for this item is shown with the ones above: graphql-Execute.salam
ResolveBool
func ResolveBool(slot: i64, b: bool)The example for this item is shown with the ones above: graphql-Execute.salam
ResolveNull
func ResolveNull(slot: i64)The example for this item is shown with the ones above: graphql-Execute.salam
Fail
func Fail(slot: i64, message: str)The example for this item is shown with the ones above: graphql-Execute.salam
ResetSlots
func ResetSlots()The example for this item is shown with the ones above: graphql-Execute.salam
TokenKindName
func TokenKindName(kind: int): strThe example for this item is shown with the ones above: graphql-Document.salam
IsStringToken
func IsStringToken(kind: int): boolThe example for this item is shown with the ones above: graphql-Document.salam
Execute
func Execute(sch: Schema, doc: Document, operationName: str, variables: value.Value, rootValue: value.Value, ctx: value.Value): ExecutionResultThe example for this item is shown with the ones above: graphql-Document.salam
ExecuteSource
func ExecuteSource(sch: Schema, source: str, operationName: str, variables: value.Value, rootValue: value.Value, ctx: value.Value): ExecutionResultThe example for this item is shown with the ones above: graphql-Execute.salam
Run
func Run(sch: Schema, source: str): ExecutionResultThe example for this item is shown with the ones above: graphql-Execute.salam
SetExtensions
func SetExtensions(r &: ExecutionResult, ext: value.Value)The example for this item is shown with the ones above: graphql-Internals.salam
ResultToValue
func ResultToValue(r: ExecutionResult): value.ValueThe example for this item is shown with the ones above: graphql-Internals.salam
ResultToJSON
func ResultToJSON(r: ExecutionResult): strThe example for this item is shown with the ones above: graphql-Execute.salam
ResultToJSONIndent
func ResultToJSONIndent(r: ExecutionResult): strThe example for this item is shown with the ones above: graphql-Internals.salam
ResultToJSONStable
func ResultToJSONStable(r: ExecutionResult): strThe example for this item is shown with the ones above: graphql-Execute.salam
ResultOk
func ResultOk(r: ExecutionResult): boolThe example for this item is shown with the ones above: graphql-Execute.salam
ResultErrorMessage
func ResultErrorMessage(r: ExecutionResult): strThe example for this item is shown with the ones above: graphql-Execute.salam
FreeResult
func FreeResult(r &: ExecutionResult)The example for this item is shown with the ones above: graphql-Execute.salam
TypeRefIsNonNull
func TypeRefIsNonNull(doc: Document, id: int): boolThe example for this item is shown with the ones above: graphql-Document.salam
TypeRefIsList
func TypeRefIsList(doc: Document, id: int): boolThe example for this item is shown with the ones above: graphql-Document.salam
TypeRefElement
func TypeRefElement(doc: Document, id: int): intThe example for this item is shown with the ones above: graphql-Internals.salam
TypeRefName
func TypeRefName(doc: Document, id: int): str!.The example for this item is shown with the ones above: graphql-Document.salam
FindType
func FindType(s: Schema, name: str): TypeDefThe example for this item is shown with the ones above: graphql-Schema.salam
HasType
func HasType(s: Schema, name: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
TypeIndex
func TypeIndex(s: Schema, name: str): intThe example for this item is shown with the ones above: graphql-Schema.salam
TypeCount
func TypeCount(s: Schema): intThe example for this item is shown with the ones above: graphql-Schema.salam
TypeAt
func TypeAt(s: Schema, i: int): TypeDefThe example for this item is shown with the ones above: graphql-Schema.salam
FindField
func FindField(t: TypeDef, name: str): FieldDefThe example for this item is shown with the ones above: graphql-Schema.salam
HasField
func HasField(t: TypeDef, name: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
FindInputField
func FindInputField(t: TypeDef, name: str): InputValueDefThe example for this item is shown with the ones above: graphql-Schema.salam
FindArg
func FindArg(f: FieldDef, name: str): InputValueDefThe example for this item is shown with the ones above: graphql-Schema.salam
FindDirectiveDef
func FindDirectiveDef(s: Schema, name: str): DirectiveDefThe example for this item is shown with the ones above: graphql-Schema.salam
HasEnumValue
func HasEnumValue(t: TypeDef, name: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
IsInputType
func IsInputType(s: Schema, name: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
IsOutputType
func IsOutputType(s: Schema, name: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
IsAbstractType
func IsAbstractType(s: Schema, name: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
IsLeafType
func IsLeafType(s: Schema, name: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
IsPossibleType
func IsPossibleType(s: Schema, abstractName: str, objectName: str): boolThe example for this item is shown with the ones above: graphql-Schema.salam
PossibleTypes
func PossibleTypes(s: Schema, name: str): Vector<str>The example for this item is shown with the ones above: graphql-Schema.salam
RootTypeName
func RootTypeName(s: Schema, optype: int): strThe example for this item is shown with the ones above: graphql-Schema.salam