graphql-nexus/nexus-prisma

FieldResolver<"Type","Field"> does not include relations, but only primitive field data types

georgekrax opened this issue · 0 comments

Description

The FieldResolver<"Type","Field"> generic type provided by nexus does not include relations.

Repro Steps/Link

For example:

export const SearchInputValueType = objectType({
  name: SearchInputValue.$name,
  description: "Represents a potential input value of a user's search",
  definition(t) {
    t.field(SearchInputValue.id);
    t.field(SearchInputValue.publicId);
    t.field(SearchInputValue.country);
    t.field(SearchInputValue.city);
    t.field(SearchInputValue.region);
    t.field(SearchInputValue.beachBar);
    t.string("formattedValue", { description: "The search input value formatted into a string", resolve: o => formatInputValue(o) });
  },
});

The o parameter here only includes the id & publicId fields, having a type of:

(parameter) o: {
    id: any;
    publicId: string;
}

Whereas it should also include the fields country, region, city and beachBar.