I am learning how to use GraphQL and I've been trying to figure out the best way to implement a directive that enforces unique usernames for a project using apollo. However, in the documentation I've read, the suggested techniques (IE generating a unique UID) for custom implementations aren't exactly what I am looking for. This is my schema:
const { gql } = require('apollo-server') // type Query is the root query exports.typeDefs = gql` type User { username: String! @unique email: String! @unique password: String! } type Query { getAllRegisteredUsers: [User] }``` Any advice greatly appreciated.
1.4m articles
1.4m replys
5 comments
56.9k users