Skip to content

Can't add field in user (users-permissions) #12016

@M1CK431

Description

@M1CK431

Feature request

Please describe your feature request

  • I have created my request on the Product Board before I submitted this issue
  • I have looked at all the other requests on the Product Board before I submitted this issue

Summary

I would like to add some extra fields in user like firstName and lastName but adding them using Content-Type Builder doesn't make them available in GraphQL API

Steps to reproduce the behavior

  1. Using the Content-Type Build, add a Text field in User
  2. Go on http://localhost:1337/graphql and check GraphQL documentation
  3. The added text field isn't exposed

Screenshots

firstName and lastName text fields added in user using Content-Type Builder:
image

Added fields not available in GraphQL API:
image

Why is it needed?

Since user is a central part for most authenticated API and adding extra fields or relations to user is a very common use case. For now, we have to manually write specific code to add extra fields (in addition to Content-Type Builder). Thanks @iicdii to remember me the way we do it in v3.

Suggested solution(s)

The added text field should be exposed, both on query and mutation.

Related issue(s)/PR(s)

None, since I have "transform" the current issue from "bug report" to "feature request" 😉

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundsource: plugin:graphqlSource is plugin/graphql packagestalestale-before-2022status: confirmedConfirmed by a Strapi Team member or multiple community members

    Type

    No type

    Projects

    Status

    Fixed/Shipped

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions