Skip to content

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
@eminkokdemir0
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