Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support ModelUncheckedCreateInput type #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gmaliar
Copy link

@gmaliar gmaliar commented Apr 25, 2022

UncheckedInputTypes allow us to pass ids to the prisma model rather than objects
An example:

Currently we connect,

export const createConnection = (userId, type) => {
  const Factory = createConnectionFactory({});

  return Factory.create({
    type,
    user: {
      connect: {
        id: userId,
      },
    },
  });
};

An alternative when ConnectionUncheckedCreateInput type is added

export const createConnection = (userId, type) => {
  const Factory = createConnectionFactory({});

  return Factory.create({
    userId,
    type,
  });
};

@mthomps4 mthomps4 requested review from cullylarson and kgajera and removed request for DominicSherman May 19, 2022 12:38
@kokdemirdev
Copy link

I had this hurdle myself. And it looks like a good solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants