graphql-codegen-factories
is a plugin for GraphQL Code Generator that generates factories based on a GraphQL schema and operations.
Those factories can then be used to create objects that match the schema, for example to mock data in tests or to seed a database.
type User {
id: ID!
username: String!
}
export function createUserMock(props: Partial<User>): User {
return {
id: "",
username: "",
...props,
};
}
Documentation · Examples · Changelog · License: MIT