-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
We got an error when we tried to generate the nexus field for google.Type.Date by using the proto-gen-nexus (version: 0.6.2).
Expected Behavior
t.field("birthday", {
type: nullable("Date"),
resolve: (source) => {
const value = source.getBirthday();
if (value == null) {
return null;
}
// THE EXPECTED
return getTransformer("google.type.Date").protoToGql(value);
},
extensions: {
protobufField: { name: "birthday", typeFullName: "google.type.Date" },
},Current Behavior
t.field("birthday", {
type: nullable("Date"),
resolve: (source) => {
const value = source.getBirthday();
if (value == null) {
return null;
}
// ACTUALITY
return value;
},
extensions: {
protobufField: { name: "birthday", typeFullName: "google.type.Date" },
}Root cause
The error was found when handling WellKnownType. Currently, it only handles google.protobuf type (by isProtobufWellKnownType), but does not handle google.Type (google.Type.Date)
Metadata
Metadata
Assignees
Labels
No labels