Connecting to multiple Dato projects with Gatsby

I’ve been using gatsby-source-datocms on my gatsby application to load data from two different projects. However, if I start a brand new app and try to connect to the same projects, it doesn’t work. It only loads the data from the first project on the gatsby-config file (see sample below).

{
resolve: gatsby-source-datocms,
options: {
apiToken: process.env.DATO_API_TOKEN,
previewMode: true,
disableLiveReload: false,
},
},
{
resolve: gatsby-source-datocms,
options: {
apiToken: process.env.DATO_API_TOKEN_MASTER,
previewMode: true,
disableLiveReload: false,
},
},

EDIT:
It seems it works if I add a spacific version of the plugin “gatsby-source-datocms”: “2.1.29”, but it breaks if I use the caret in front of the version “gatsby-source-datocms”: “^2.1.29”. Also it seems it doesn’t work at all with any of the 2.2.x versions of the plugin.

@jgiraldo can you please check which version of the datocms-client you have installed in your package.lock/yarn.lock file?

I fixed that in 3.0.17 of that package, which is a dependency of our Gatsby source. If that is the case, can you maybe share access to your repo so that I can better replicate your issue? (feel free to send details over DM)

I have datocms-client “>=3.0.16”

check in the lock file to see what’s the version that you are actually using, if you have that in the package.json might mean that you have an old version.

If instead you have 3.0.17 can you please send over a link for your repo (via DM). Thanks!