graphql-faker icon indicating copy to clipboard operation
graphql-faker copied to clipboard

Allow to override existing schema with GraphQL-faker

Open rossoha opened this issue 3 years ago • 0 comments

At the moment faker doesn't allow to override fields that already on the backend, but there might be a situation when existing API is not yet implemented and return some default value (like null). So it would be nice to have a way to override such a response.

Example error message: Field "User.firstName" already exists in the schema. It cannot also be defined in this type extension.

Example schema from server:

type User {
    _instanceName: String
     id: UUID
    firstName: String
    lastName: String
}

Example extension file content :

extend type User {  
  firstName: String @fake(type: firstName)
}

rossoha avatar Sep 15 '21 14:09 rossoha