Keystone: wysiwyg field causes keystone error GraphQLError: Syntax Error: Expected :, found (

Created on 27 Aug 2020  Â·  4Comments  Â·  Source: keystonejs/keystone

Bug report

Describe the bug

when i tried to add certain fields like wysiwyg field, i got keystone unable to boot.

To Reproduce

Steps to reproduce the behaviour. Please provide code snippets or a repository

example:

const { Wysiwyg } = require('@keystonejs/fields-wysiwyg-tinymce');
exports.Todo = {
  schemaDoc: 'A list of things which need to be done',
  fields: {
    name: { type: Text, schemaDoc: 'This is the thing you need to do', required: true },
    description: { type: Wysiwyg, schemaDoc: 'Task description here', editorConfig: {} },
  },
  adminConfig: {
    defaultPageSize: 20,
  }
}

Expected behaviour

keystone to start

error:

✖ Initialising Keystone instance
GraphQLError: Syntax Error: Expected :, found (
at syntaxError (/mnt/c/james/www/project/node_modules/graphql/error/syntaxError.js:15:10)
at Parser.expectToken (/mnt/c/james/www/project/node_modules/graphql/language/parser.js:1404:40)
at Parser.parseInputValueDef (/mnt/c/james/www/project/node_modules/graphql/language/parser.js:890:10)
at Parser.optionalMany (/mnt/c/james/www/project/node_modules/graphql/language/parser.js:1497:28)
at Parser.parseInputFieldsDefinition (/mnt/c/james/www/project/node_modules/graphql/language/parser.js:1052:17)
at Parser.parseInputObjectTypeDefinition (/mnt/c/james/www/project/node_modules/graphql/language/parser.js:1036:23)
at Parser.parseTypeSystemDefinition (/mnt/c/james/www/project/node_modules/graphql/language/parser.js:708:23)
at Parser.parseDefinition (/mnt/c/james/www/project/node_modules/graphql/language/parser.js:146:23)
at Parser.many (/mnt/c/james/www/project/node_modules/graphql/language/parser.js:1518:26)
at Parser.parseDocument (/mnt/c/james/www/project/node_modules/graphql/language/parser.js:111:25)
at parse (/mnt/c/james/www/project/node_modules/graphql/language/parser.js:36:17)
at parseDocument (/mnt/c/james/www/project/node_modules/graphql-tag/lib/graphql-tag.umd.js:135:16)
at gql (/mnt/c/james/www/project/node_modules/graphql-tag/lib/graphql-tag.umd.js:176:10)
at /mnt/c/james/www/project/node_modules/@keystonejs/keystone/lib/Keystone/index.js:534:17
at Array.map ()
at Keystone.getTypeDefs (/mnt/c/james/www/project/node_modules/@keystonejs/keystone/lib/Keystone/index.js:534:8) {
locations: [ { line: 5, column: 21 } ]
}

System information

  • OS: linux
  • Browser chrome (not relevant)

Additional context

Most helpful comment

yarn add @keystonejs/[email protected]

All 4 comments

yarn add @keystonejs/[email protected]

found this in the graphsql check:

        input TodoUpdateInput {
          name: String
started: Boolean
gqlUpdateInputFields() {
    return [`${this.path}: String`];
  }
        }

✖ Initialising Keystone instance
GraphQLError: Syntax Error: Expected :, found (

iam already using "@keystonejs/fields-wysiwyg-tinymce": "^5.3.6",

@caesarisme thank you :) it works now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jesstelford picture jesstelford  Â·  19Comments

ricardonogues picture ricardonogues  Â·  10Comments

gautamsi picture gautamsi  Â·  14Comments

wesbos picture wesbos  Â·  16Comments

amorote picture amorote  Â·  21Comments