From fcd27be3ded5dea5f71c6bf36fe1bc95041adeb7 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 19 Jun 2023 15:43:04 -0600 Subject: [PATCH] Fixed valid_events and valid_resources --- gql.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gql.go b/gql.go index e7cf337..faa177c 100644 --- a/gql.go +++ b/gql.go @@ -933,10 +933,12 @@ func MakeGQLHandlers(server * GQLServer) (func(http.ResponseWriter, *http.Reques valid_resources[reflect.TypeOf((*BaseResource)(nil))] = GQLTypeBaseResource() gql_types := []graphql.Type{GQLTypeBaseEvent(), GQLTypeEventQueue(), GQLTypeSignal(), GQLTypeSignalInput(), GQLTypeBaseNode()} + event_type := reflect.TypeOf((Event)(nil)) + resource_type := reflect.TypeOf((Resource)(nil)) for go_t, gql_t := range(server.extended_types) { - if _, ok := go_t.(Event); ok { + if go_t.Implements(event_type) { valid_events[go_t] = gql_t - } else if _, ok := go_t.(Resource); ok { + } else if go_t.Implements(resource_type) { valid_resources[go_t] = gql_t } gql_types = append(gql_types, gql_t)