Right now you can either use custom defined models compare with schema.graphql definition to generate resolvers.
Or you can use gqlgen.yml to config resolvers like
models:
Topic:
fields:
replies:
resolver: true
I suggest another way to mark a field as resolver by using https://graphql.github.io/graphql-spec/draft/#sec-Type-System.Directives
For example:
directive @resolver on FIELD_DEFINITION
type Topic {
id: ID!
title: String!
replies: [Reply!] @resolver
}
This way, Field definition and whether it is a resolver are in the same place. So you won't forget to remove one or another when changing
Yeah there are a bunch of these, @model, @resolver, @name could be interesting
Done!
Most helpful comment
Yeah there are a bunch of these,
@model,@resolver,@namecould be interesting