ryannealmes
06/14/2018, 6:56 PMtabsnotspaces
06/14/2018, 6:57 PMtabsnotspaces
06/14/2018, 6:58 PMrequired
to be returnedtabsnotspaces
06/14/2018, 6:58 PMryannealmes
06/14/2018, 6:59 PMryannealmes
06/14/2018, 6:59 PMtype User{
id: ID! @unique
name: String! @unique
username: String! @unique
email: String! @unique
password: String!
teams: [Team!]!
}
ryannealmes
06/14/2018, 6:59 PMryannealmes
06/14/2018, 6:59 PMryannealmes
06/14/2018, 7:00 PMtabsnotspaces
06/14/2018, 7:02 PMcreateUser
mutation will need to have a password in the payload. but querying for a user you can specify whatever fields you wantryannealmes
06/14/2018, 7:03 PMryannealmes
06/14/2018, 7:03 PMryannealmes
06/14/2018, 7:04 PMryannealmes
06/14/2018, 7:04 PMlewebsimple
06/14/2018, 7:37 PMlewebsimple
06/14/2018, 7:38 PMtype Mutation {
signup(email: String!, password: String!): User
}
tabsnotspaces
06/14/2018, 7:42 PMtimm
06/14/2018, 7:50 PMdatamodel.graphql
you would include the password field, but in the schema.graphql which is the second layer where you would expose your api to calls, you would "redefine" type User { ... }
in there and include only the fields you want to expose, so leave out password and anything that you don't want to be able to query.timm
06/14/2018, 7:52 PMtype Query { ... }
and type Mutation { ... }
you literally add something like
type User {
id: ID!
email: String!
name: String!
}
timm
06/14/2018, 7:52 PMryannealmes
06/14/2018, 8:01 PMryannealmes
06/14/2018, 8:01 PMryannealmes
06/14/2018, 8:01 PMryannealmes
06/14/2018, 8:01 PMryannealmes
06/14/2018, 8:02 PMryannealmes
06/14/2018, 8:02 PM