Skip to content

Add ability to specify local mock file #13

@just-be-dev

Description

@just-be-dev

First off, this project is amazing. It's extremely useful for bootstrapping an app before the graphql server exists.

The faker methods are extremely useful, but I'm finding myself wishing I could run custom code to generate what I need in certain scenarios.

What if there was something like this

schema.faker.graphql

type JiraIssue {
  id: ID @fake(type: uuid)
  key: String @fake(type: mock, func: "jiraIssue")
}

graphql-faker-mocks.js

// Imagine this function does something more exciting
export const jiraIssue = () => 'ABC-123'

The semantics here might not be great. It could be a separate directive or the parameters could be different. Ultimately the idea is just to be able to custom mocks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions