This PR adds the necessary resolvers to support the graphQL front-end. Some additional methods need to be added to the model structs to support this. Comments have been made to clarify their purpose. There is a slight duplication of code in the api layer. But eventually that's going to go away when we move away from the REST API entirely. The schema is in api4/schema.graphqls and gets compiled into the binary as an asset. The GraphiQL editor url is at GET /api/v5/graphql. Everything is behind the feature flag MM_FEATUREFLAGS_GRAPHQL. ```release-note NONE ```
14 строки
495 B
Go
14 строки
495 B
Go
package decode
|
|
|
|
// Unmarshaler defines the api of Go types mapped to custom GraphQL scalar types
|
|
type Unmarshaler interface {
|
|
// ImplementsGraphQLType maps the implementing custom Go type
|
|
// to the GraphQL scalar type in the schema.
|
|
ImplementsGraphQLType(name string) bool
|
|
// UnmarshalGraphQL is the custom unmarshaler for the implementing type
|
|
//
|
|
// This function will be called whenever you use the
|
|
// custom GraphQL scalar type as an input
|
|
UnmarshalGraphQL(input interface{}) error
|
|
}
|