Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeProcedureName ¶
NormalizeProcedureName normalizes the procedure name to a valid typescript function name For example, todo.create -> todoCreate, sign-in -> signIn etc This is done to ensure that the generated method names are valid
Types ¶
type GenerateBindingsOpts ¶
type GenerateBindingsOpts struct {
// Whether to include the schema in the generated bindings file or not
IncludeSchema bool
// The generated schema type
Schema string
// Whether to use the union result type or not - when enabled, the result type will be a uniion of the Ok and Error types which would disallow access to any of the fields without checking the `ok` field first
UseUnionResult bool
// Whether to throw a ProcedureCallError when a procedure call fails for any reason (e.g. invalid payload, user-defined error, etc.) instead of returning an error result
ThrowOnError bool
}
type GenerateMethodsOpts ¶
type GenerateMethodsOpts struct {
ThrowOnError bool
}
type GeneratedMethods ¶
type MethodTemplateOpts ¶
type TemplateOpts ¶
type TemplateOpts struct {
// Whether to include the schema in the generated bindings file or not
IncludeSchema bool
// The generated schema type
Schema string
// The generated query methods
QueryMethods string
// The generated mutation methods
MutationMethods string
// Whether to use the union result type or not - when enabled, the result type will be a uniion of the Ok and Error types which would disallow access to any of the fields without checking the `ok` field first
UseUnionResult bool
// Whether to throw a ProcedureCallError when a procedure call fails for any reason (e.g. invalid payload, user-defined error, etc.) instead of returning an error result
ThrowOnError bool
}
Click to show internal directories.
Click to hide internal directories.