Solved see ticket Does anyone know how to overrid...
# graphql-nexus
l
Solved see ticket Does anyone know how to override FieldResolver in typescript? Because i want to change FieldResolver because it don't support function fields that returning the value. For example i have the following typing
Copy code
objectType({
  name: 'TestQuery',
  definition(t) {
    t.field('hello', {type: 'String'});
    t.field('hello2', {type: 'String'});
  },
}),
extendType({
  type: 'Query',
  definition(t) {
    t.field('test', {
      type: 'TestQuery',
      resolve: () => ({
        hello: () => ... function that returns promise<String>,
        hello2: () => ... function that returns promise<String>,
      }),
    });
  },
}),
Gives the following Message
Copy code
Error:(73, 13) TS2322: Type '() => Promise<string>' is not assignable to type 'string'.
l
this is the “resolve” function that should returns a Promise<{hello: string, hello2: string}>
l
Hmmm but it works if I ignore the errors so that's weird right?