question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GraphQL syntax error when using cloudinary image

See original GitHub issue

Description

Trying to use cloudinaryImage field. Keystone fails to start throwing a GraphQL syntax error

To Reproduce

Followed the instructions at: https://www.keystonejs.com/keystonejs/fields-cloudinary-image/

const { Keystone } = require('@keystonejs/keystone');
const { CloudinaryAdapter } = require('@keystonejs/file-adapters');
const { CloudinaryImage } = require('@keystonejs/fields-cloudinary-image');

const keystone = new Keystone({...});

const fileAdapter = new CloudinaryAdapter({
  cloudName: process.env.CLOUDINARY_CLOUD_NAME,
  apiKey: process.env.CLOUDINARY_KEY,
  apiSecret: process.env.CLOUDINARY_SECRET,
  folder: 'my-keystone-app',
});

keystone.createList('Image', {
  fields: {
    image: { type: CloudinaryImage, adapter: fileAdapter },
  },
});

System information

  • OS: macOS

Additional context

error thrown:

✖ Initialising Keystone instance
GraphQLError: Syntax Error: Expected :, found (
    at syntaxError (project/node_modules/graphql/error/syntaxError.js:15:10)
    at Parser.expectToken (project/node_modules/graphql/language/parser.js:1404:40)
    at Parser.parseInputValueDef (project/node_modules/graphql/language/parser.js:890:10)
    at Parser.optionalMany (project/node_modules/graphql/language/parser.js:1497:28)
    at Parser.parseInputFieldsDefinition (project/node_modules/graphql/language/parser.js:1052:17)
    at Parser.parseInputObjectTypeDefinition (project/node_modules/graphql/language/parser.js:1036:23)
    at Parser.parseTypeSystemDefinition (project/node_modules/graphql/language/parser.js:708:23)
    at Parser.parseDefinition (project/node_modules/graphql/language/parser.js:146:23)
    at Parser.many (project/node_modules/graphql/language/parser.js:1518:26)
    at Parser.parseDocument (project/node_modules/graphql/language/parser.js:111:25)
    at parse (project/node_modules/graphql/language/parser.js:36:17)
    at parseDocument (project/node_modules/graphql-tag/lib/graphql-tag.umd.js:135:16)
    at gql (project/node_modules/graphql-tag/lib/graphql-tag.umd.js:176:10)
    at project/node_modules/@keystonejs/keystone/lib/Keystone/index.js:533:17
    at Array.map (<anonymous>)
    at Keystone.getTypeDefs (project/node_modules/@keystonejs/keystone/lib/Keystone/index.js:533:8) {
  message: 'Syntax Error: Expected :, found (',
  locations: [ { line: 3, column: 31 } ]
}
"@keystonejs/fields-cloudinary-image": "^1.0.2",
"@keystonejs/file-adapters": "^7.0.3",

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
diligntcommented, Apr 8, 2021

It is so frustrating for those of us trying to go to production with this version of Keystone that critical outstanding issues such as this one are simply closed without being addressed. I know that this version is now in “maintainence mode”, but how is the community able to maintain it when they don’t know what the issues are because they have been closed without resolution? Is it your intention that outstanding issues such as these are reopened in the keystone-5 repository?

It seems that this is not maintence mode, but simply mothballing this version of the project, with no prospect of any maintenance at all. When pull requests such as this one are invited to be applied to Keystone Next instead, signalling that there is no prospect of them ever being released in current form, how will we ever go to production with any new fixes or features?

I have been a huge fan and avid user of all the versions of Keystone for years, and I’m sure that Keystone Next will be great, but it is not ready for production yet either, and for those of us trying to make a success of small startup businesses and deliver to clients right now using Keystone, and who don’t have the bandwidth to fork and maintain our own bespoke versions, this repeated mothballing of Keystone versions before they are production ready is extremely disappointing and has a huge impact on our ability to deliver for our customers and clients.

0reactions
bladeycommented, Apr 8, 2021

Keystone 5 has officially moved into active maintenance mode as we push towards the next major new version Keystone Next, you can find out more information about this transition here.

In an effort to sustain the project going forward, we’re cleaning up and closing old issues such as this one. If you feel this issue is still relevant for Keystone Next, please let us know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apollo-upload-client with Cloudinary - node.js - Stack Overflow
I am trying out uploading images using apollo- ...
Read more >
Image Transformations for Developers - Cloudinary
Learn how to dynamically transform images with one line of code: crop, resize, add borders and background, face detection, rich image ...
Read more >
Lift-off i: basics - Help - Apollo GraphQL
It looks like some kind of syntax error happening somewhere. First, let's see if the server is running and returning a response properly....
Read more >
Image management via GraphQL by Tamas Piros
From Node.js "forward" the image to Cloudinary for final storage. Later on, we'll also take a look at how to retrieve the image...
Read more >
GraphQL File Upload (with React & Apollo) - YouTube
Become a Patron and help the channel growhttps://www.patreon.com/classsed ‍ ‍ Join the communityDiscord: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found