Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

strapi extend user model

//Path: src/index.js

register({ strapi }) {
    const extensionService = strapi.plugin("graphql").service('extension');
    extensionService.use(({ nexus }) => ({
      types: [
        nexus.extendInputType({
          type: 'UsersPermissionsRegisterInput',
          definition(t) {
            // here define fields you need
            t.string('userType');
            t.string('location');
          },
        }),
      ],
    }));
    extensionService.use(({ nexus }) => ({
      types: [
        nexus.extendType({
          type: 'UsersPermissionsMe',
          definition(t) {
            // here define fields you need
            t.string('userType');
            t.string('location');
          },
        }),
      ]
    }));
  },
Comment

PREVIOUS NEXT
Code Example
Javascript :: route methods 
Javascript :: cache blogposts for 24 hours react native 
Javascript :: how do i make http post in nodejs without third party 
Javascript :: map and get last child in js 
Javascript :: canvas getting created at bottom of page 
Javascript :: typeorm sqlite Using Repositories 
Javascript :: typeorm caching queries time limit globally 
Javascript :: next-pwa push notification 
Javascript :: jit and aot 
Javascript :: socket cheatsheet 
Javascript :: url.createobjecturl 
Javascript :: simple-react-validator 
Javascript :: js uid from 8 characters or digits 
Javascript :: Custom usePagination hook 
Javascript :: javascript on enter keyup select button 
Javascript :: prevent the fire of parent event listener 
Javascript :: javascript coding test interview 
Javascript :: javascript copy input value to clipboard 
Javascript :: get src vanilla js 
Javascript :: polling interval javascript 
Javascript :: console form elememts as json object 
Javascript :: how to prevent todos from vanishing after refreshing page - javascript 
Javascript :: peopleToSendMessage 
Javascript :: linked list distance between two nodes 
Javascript :: Format Mathjax 
Javascript :: update mongoose 
Javascript :: yup password match 
Javascript :: create ew angular app 
Javascript :: es6 parameter destructuring nested object 
Javascript :: Installation de react native maps bibliothèque 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =