Skip to content

ertrzyiks/graphql-codegen-factories

 
 

Repository files navigation

graphql-codegen-factories

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

Contributors

About

graphql-codegen plugin to generate factories

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.7%
  • JavaScript 0.3%