Question

problem using example in NodeJs

  • 13 January 2022
  • 0 replies
  • 311 views

Userlevel 2

Hi, I'm using node, and I got the example in the documentation, but when I run it, it gives me this error, and on the site where the example is executed, it's running normally.

Thanks.

Link example: https://developers.pipefy.com/reference/graphql-endpoint

 

Code:

sdk['graphql-endpoint']({  query: '{allCards(pipeId: 302194528){edges{node{id}}}}'}, {  Authorization: 'Bearer *token*'})  .then(res => console.log(res))  .catch(err => console.error(err))

 

Response:


{
>    '0': {
>      instancePath: '/paths',
>      schemaPath: '#/additionalProperties',
>      keyword: 'additionalProperties',
>      params: { additionalProperty: '' },
>      message: 'must NOT have additional properties',
>      isIdentifierLocation: true
>    },
>    stack: 'SyntaxError: OpenAPI schema validation failed.\n' +
>      '\n' +
>      'ADDITIONAL PROPERTY must NOT have additional properties\n' +
>      '\n' +
>      '  24 |   ],\n' +
>      '  25 |   "paths": {\n' +
>      '> 26 |     "": {\n' +
>      '     |     ^^   is not expected to be here!\n' +
>      '  27 |       "post": {\n' +
>      '  28 |         "summary": "Example",\n' +
>      '  29 |         "description": "",\n' +
>  
>    message: 'OpenAPI schema validation failed.\n' +
>      '\n' +
>      'ADDITIONAL PROPERTY must NOT have additional properties\n' +
>      '\n' +
>      '  24 |   ],\n' +
>      '  25 |   "paths": {\n' +
>      '> 26 |     "": {\n' +
>      '     |     ^^   is not expected to be here!\n' +
>      '  27 |       "post": {\n' +
>      '  28 |         "summary": "Example",\n' +
>      '  29 |         "description": "",',
>    length: 1,
>    concat: [Function: concat],
>    copyWithin: [Function: copyWithin],
>    fill: [Function: fill],
>    find: [Function: find],
>    findIndex: [Function: findIndex],
>    lastIndexOf: [Function: lastIndexOf],
>    pop: [Function: pop],
>    push: [Function: push],
>    reverse: [Function: reverse],
>    shift: [Function: shift],
>    unshift: [Function: unshift],
>    slice: [Function: slice],
>    sort: [Function: sort],
>    splice: [Function: splice],
>    includes: [Function: includes],
>    indexOf: [Function: indexOf],
>    join: [Function: join],
>    keys: [Function: keys],
>    entries: [Function: entries],
>    values: [Function: values],
>    forEach: [Function: forEach],
>    filter: [Function: filter],
>    flat: [Function: flat],
>    flatMap: [Function: flatMap],
>    map: [Function: map],
>    every: [Function: every],
>    some: [Function: some],
>    reduce: [Function: reduce],
>    reduceRight: [Function: reduceRight],
>    at: [Function: at],
>    toJSON: [Function: toJSON],
>    details: [
>      {
>        instancePath: '/paths',
>        schemaPath: '#/additionalProperties',
>        keyword: 'additionalProperties',
>        params: [Object],
>        message: 'must NOT have additional properties',
>        isIdentifierLocation: true
>      }
>    ],
>    name: 'SyntaxError',
>    toString: [Function: toString],
>    [Symbol(Symbol.iterator)]: [Function: values],
>    [Symbol(Symbol.unscopables)]: [Object: null prototype] {
>      copyWithin: true,
>      entries: true,
>      fill: true,
>      find: true,
>      findIndex: true,
>      flat: true,
>      flatMap: true,
>      includes: true,
>      keys: true,
>      values: true,
>      at: true
>    }
>  }


 


0 replies

Be the first to reply!

Reply