diff --git a/graph.go b/graph.go index 7619fc1..0ad3fd7 100644 --- a/graph.go +++ b/graph.go @@ -42,7 +42,7 @@ type GQLContext struct { ThreadType reflect.Type } -func NewGQLContext(additional_types TypeList, extended_types ObjTypeMap, extended_queries FieldMap, extended_mutations FieldMap, extended_subscriptions FieldMap) (*GQLContext, error) { +func NewGQLContext(additional_types TypeList, extended_types ObjTypeMap, extended_queries FieldMap, extended_subscriptions FieldMap, extended_mutations FieldMap) (*GQLContext, error) { type_list := TypeList{ GQLTypeSignalInput(), } @@ -90,14 +90,6 @@ func NewGQLContext(additional_types TypeList, extended_types ObjTypeMap, extende queries[key] = val } - mutations := graphql.Fields{ - "SendUpdate": GQLMutationSendUpdate(), - } - - for key, val := range(extended_mutations) { - mutations[key] = val - } - subscriptions := graphql.Fields{ "Update": GQLSubscriptionUpdate(), } @@ -106,6 +98,14 @@ func NewGQLContext(additional_types TypeList, extended_types ObjTypeMap, extende subscriptions[key] = val } + mutations := graphql.Fields{ + "SendUpdate": GQLMutationSendUpdate(), + } + + for key, val := range(extended_mutations) { + mutations[key] = val + } + schemaConfig := graphql.SchemaConfig{ Types: type_list, Query: graphql.NewObject(graphql.ObjectConfig{