Skip to content

Name field in keystone #374

@shobhit-stan

Description

@shobhit-stan

I have a name field on user in my postgresql database.

const userFields = {
    fields: {
        phone: {
            type: Text,
            isUnique: true,
        },
        name: {
            type: Text,
        },
        username: {
            type: Text,
        },
        user_type: {
            type: Select,
            options: [
                { value: 'ADMIN', label: 'Admin' },
                { value: 'USER', label: 'User' }
            ]
        },
        email: {
          type: Text,
          isUnique: true,
        },
        password: {
          type: Password,
        },
        joinedRooms: {
            type: Relationship,
            ref: 'player.followers',
            many: true,
            isRequired: false
        },
    },
    labelResolver: item => item.email,
}

Now this name can also be null if user don't pick a name first. Now keystone don't load up tuples where name is null. I then use another labelResolver as put it as email but still keystone is not loading name null fields.
Should there not be a command to override the default summary or label field keystone uses?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions