# Custom field resolver not found

**URL:** <https://community.neo4j.com/t/custom-field-resolver-not-found/60922>\
**Category:** GraphQL & GRANDstack\
**Created:** [February 16, 2023, 12:30pm UTC](https://community.neo4j.com/t/custom-field-resolver-not-found/60922 "2023-02-16T12:30:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankou29666](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ankou29666](https://community.neo4j.com/u/ankou29666)\
**Post date:** [February 16, 2023, 12:30pm UTC](https://community.neo4j.com/t/custom-field-resolver-not-found/60922/1 "2023-02-16T12:30:26Z")

</div>

Hi everyone.

I'm trying to create a custom field resolver resolver (yes, this time I'm actually talking about the @customResolver directive)

so in my typedefs I defined (among other stuff

```auto
    type USER @exclude(operations: [CREATE, UPDATE, DELETE])
    {
        user_id: ID! @id(autogenerate:true) @readonly

        lastName: String!
        firstName: String!
        dob: Date! # some @auth directive here
        gender: GENDER! # => Enum : Undef / Male / Female
        profileUpdateRequired: Boolean! @customResolver (requires: ["lastName", "firstName", "dob", "gender"])

        member_of_club: [CLUB!]! @relationship (type: "MEMBER_OF", direction: OUT)

        # And lots of other stuff
    }

    extend type USER @auth 
    (
        rules: 
        [
            {
                operations: [READ],
                allow: ${userAuthorizations.userRead} 
                # userAuthorizations.userRead = '{ user_id: "$jwt.user_id" }' (for the moment) from externally defined string
            }
        ]
    )
```

In my resolvers I have

```auto
const resolvers =
{
    USER:
    {
        profileUpdateRequired (source)
        {
            return source.lastName==="" || source.firstName==="" || source.dob==="0001-01-01" || 
                    (source.gender!=="Male" && source.gender!=="Female")
        }
    },
    Query:
    {
        // ...userResolvers.Query
    },
    Mutation:
    {
        ...userResolvers.Mutation
    },
    Subscription:
    {
        // ...userResolvers.Subscription
    },
} 
```

results in this error

```auto
C:\Users\Surface\Insync\ankou29666@gmail.com\Google Drive\dev\serveur\graphql\node_modules\@neo4j\graphql\dist\schema\get-custom-resolver-meta.js:46
        throw new Error(`Custom resolver for ${field.name.value} has not been provided`);
              ^

Error: Custom resolver for profileUpdateRequired has not been provided
```

I have compared again and again and again with the example from the documentation but this still doesn't work and I don't understand what I'm missing. However I'm surprised by ${field.name.value} within a backtick quote.

Any idea ?  
Thanks for your help

---

<div class="post-metadata">

**Author:** ![ankou29666](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ankou29666](https://community.neo4j.com/u/ankou29666)\
**Post date:** [March 19, 2023, 4:58pm UTC](https://community.neo4j.com/t/custom-field-resolver-not-found/60922/2 "2023-03-19T16:58:20Z")

</div>

still facing the problem

---

<div class="post-metadata">

**Author:** ![lyonwj](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/lyonwj/32/27358_2.png) [@lyonwj](https://community.neo4j.com/u/lyonwj)\
**Post date:** [March 19, 2023, 7:23pm UTC](https://community.neo4j.com/t/custom-field-resolver-not-found/60922/3 "2023-03-19T19:23:23Z")

</div>

Can you share how you are passing the resolver map to the Neo4j GraphQL library?

---

<div class="post-metadata">

**Author:** ![ankou29666](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ankou29666](https://community.neo4j.com/u/ankou29666)\
**Post date:** [March 19, 2023, 7:33pm UTC](https://community.neo4j.com/t/custom-field-resolver-not-found/60922/4 "2023-03-19T19:33:50Z")

</div>

Hi and thanks for your answer. However it's unclear to me what you are talking about with "passing the resolver map". Do you mean this ?

```auto
const neo4jgraphql = new Neo4jGraphQL (
{
    typeDefs, 
    resolvers,
    driver: neo4jdriver,
    plugins: 
    {
        // TODO : replace default subscription plugin by custom redis plugin
        subscriptions: redisSubscriptions,
        auth: new Neo4jGraphQLAuthJWTPlugin(
        {
            secret: process.env.JWT_SESSION_KEY,
            globalAuthentication: false,
        }),
    },
})

const neo4jschema = await neo4jgraphql.getSchema()

```

Edit : using neo4j-driver 5.5.0 on original post, updated since to 5.6.0
