Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindFieldInSelectionSet ¶
func FindFieldInSelectionSet(field string, set *ast.SelectionSet) (found bool)
Types ¶
type ErrorHandler ¶
type ErrorHandler interface { TypeSpecificError(data *[]byte, s string) (err error) GetErrorMap(v interface{}, result map[string]interface{}) ServerError(data *[]byte, s string) (err error) }
ErrorHandler decouples error handling from a possible implementation. ErrorHandler magic is due to Go's embedding: https://go.dev/doc/effective_go#embedding https://genekuo.medium.com/composition-with-structures-and-method-forwarding-in-go-9a9045f2c1fd
type Model ¶
type Model interface { // GetResourceModel Return the generated resource.Model GetResourceModel() interface{} // GetResourceModels Return the generated resource.Model(s) as an array for List GetResourceModels() []interface{} // GetGraphQLFragment get the GraphQL fragment from resource.Model GetGraphQLFragment() *string // SetIdentifier set the identifier in the generated resource.Model SetIdentifier(g *string) // GetIdentifier get the identifier in the generated resource.Model GetIdentifier() *string // GetIdentifierKey the response key that has the guid/id/pk GetIdentifierKey(a Action) string // GetCreateMutation get the GraphQL mutation for Create GetCreateMutation() string // GetDeleteMutation get the GraphQL mutation for Delete GetDeleteMutation() string // GetUpdateMutation get the GraphQL mutation for Update GetUpdateMutation() string // GetReadQuery get the GraphQL query for Read GetReadQuery() string // GetListQuery get the GraphQL query for List GetListQuery() string // GetListQueryNextCursor get the GraphQL query for pagination, NEXTCURSOR is the template param GetListQueryNextCursor() string // GetVariables return moustache substitution variables from resource.Model GetVariables() map[string]string // AppendToResourceModels adds a resource.Model to resource.Model.ResourceModels AppendToResourceModels(m Model) // NewModelFromGuid creates a new Model with the passed guid TODO change Guid to Identifier NewModelFromGuid(g interface{}) Model // GetErrorKey returns the key of the error 'type' field GetErrorKey() string HasTags() bool GetTags() map[string]string GetTagIdentifier() *string }
type ResultHandler ¶
type ResultHandler interface { Create(m Model, b []byte) (err error) Delete(m Model, b []byte) (err error) List(m Model, b []byte) (err error) Read(m Model, b []byte) (err error) Update(m Model, b []byte) (err error) }
ResultHandler magic is due to Go's embedding: https://go.dev/doc/effective_go#embedding and https://genekuo.medium.com/composition-with-structures-and-method-forwarding-in-go-9a9045f2c1fd
Click to show internal directories.
Click to hide internal directories.