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

How to correctly use useMaster with graphql-sequelize?

Open AnderLuiz opened this issue 8 months ago • 1 comments

Hi everyone,

I would like to know how to correctly use useMaster with graphql-sequelize.

I'm trying to force the query to go to the master database using this code:

before: (findOptions) => {
  const options = findOptions;
  options.useMaster = true;
  return options;
}

However, even setting useMaster: true, the query still goes to the replica.

I'm also using dataloader-sequelize integrated with graphql-sequelize.

Is there a correct way to make it work? Or is there any additional configuration needed to make useMaster respected?

Thanks!

AnderLuiz avatar Apr 28 '25 15:04 AnderLuiz