Basic API works.

This commit is contained in:
2020-05-08 15:54:40 +02:00
parent 6837e7b4c8
commit 564ac0d24a
36 changed files with 1450 additions and 80 deletions
+19
View File
@@ -0,0 +1,19 @@
package graphutil
import (
"context"
"github.com/99designs/gqlgen/graphql"
)
func SelectsAnyField(ctx context.Context, fields ...string) bool {
collectedFields := graphql.CollectFieldsCtx(ctx, []string{"description"})
for _, collectedField := range collectedFields {
for _, field := range fields {
if collectedField.Name == field {
return true
}
}
}
return false
}