Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import dont work #5

Closed
slaxxarn opened this issue Sep 10, 2020 · 5 comments
Closed

Import dont work #5

slaxxarn opened this issue Sep 10, 2020 · 5 comments

Comments

@slaxxarn
Copy link

Hi.

I'm testing out crystallize to see if it fits our workflow and was going to test this import script to see how it worked. But i cannot get it to work.

When running the npm start, following errors appear.

⠧ Getting tenant infoResponse {
  size: 0,
  timeout: 0,
  [Symbol(Body internals)]:
   { body:
      PassThrough {
        _readableState: [ReadableState],
        readable: true,
        _events: [Object],
        _eventsCount: 2,
        _maxListeners: undefined,
        _writableState: [WritableState],
        writable: false,
        allowHalfOpen: true,
        _transformState: [Object] },
     disturbed: false,
     error: null },
  [Symbol(Response internals)]:
   { url: 'https://pim.crystallize.com/graphql',
     status: 400,
     statusText: 'Bad Request',
     headers: Headers { [Symbol(map)]: [Object] },
     counter: 0 } }

 Error: {
  "errors": [
    {
      "message": "Unknown argument \"id\" on field \"Query.tenant\".",
      "locations": [
        {
          "line": 2,
          "column": 16
        }
      ],
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED",
        "exception": {
          "stacktrace": [
            "GraphQLError: Unknown argument \"id\" on field \"Query.tenant\".",
            "    at Object.Argument (/opt/app/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js:46:29)",
            "    at Object.enter (/opt/app/node_modules/graphql/language/visitor.js:323:29)",
            "    at Object.enter (/opt/app/node_modules/graphql/utilities/TypeInfo.js:370:25)",
            "    at visit (/opt/app/node_modules/graphql/language/visitor.js:243:26)",
            "    at Object.validate (/opt/app/node_modules/graphql/validation/validate.js:69:24)",
            "    at validate (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:221:34)",
            "    at Object.<anonymous> (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:118:42)",
            "    at Generator.next (<anonymous>)",
            "    at fulfilled (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:5:58)",
            "    at runMicrotasks (<anonymous>)",
            "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
          ]
        }
      }
    },
    {
      "message": "Cannot query field \"rootItemId\" on type \"TenantQueries\".",
      "locations": [
        {
          "line": 3,
          "column": 11
        }
      ],
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED",
        "exception": {
          "stacktrace": [
            "GraphQLError: Cannot query field \"rootItemId\" on type \"TenantQueries\".",
            "    at Object.Field (/opt/app/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js:46:31)",
            "    at Object.enter (/opt/app/node_modules/graphql/language/visitor.js:323:29)",
            "    at Object.enter (/opt/app/node_modules/graphql/utilities/TypeInfo.js:370:25)",
            "    at visit (/opt/app/node_modules/graphql/language/visitor.js:243:26)",
            "    at Object.validate (/opt/app/node_modules/graphql/validation/validate.js:69:24)",
            "    at validate (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:221:34)",
            "    at Object.<anonymous> (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:118:42)",
            "    at Generator.next (<anonymous>)",
            "    at fulfilled (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:5:58)",
            "    at runMicrotasks (<anonymous>)",
            "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
          ]
        }
      }
    },
    {
      "message": "Cannot query field \"shapes\" on type \"TenantQueries\".",
      "locations": [
        {
          "line": 4,
          "column": 11
        }
      ],
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED",
        "exception": {
          "stacktrace": [
            "GraphQLError: Cannot query field \"shapes\" on type \"TenantQueries\".",
            "    at Object.Field (/opt/app/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js:46:31)",
            "    at Object.enter (/opt/app/node_modules/graphql/language/visitor.js:323:29)",
            "    at Object.enter (/opt/app/node_modules/graphql/utilities/TypeInfo.js:370:25)",
            "    at visit (/opt/app/node_modules/graphql/language/visitor.js:243:26)",
            "    at Object.validate (/opt/app/node_modules/graphql/validation/validate.js:69:24)",
            "    at validate (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:221:34)",
            "    at Object.<anonymous> (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:118:42)",
            "    at Generator.next (<anonymous>)",
            "    at fulfilled (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:5:58)",
            "    at runMicrotasks (<anonymous>)",
            "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
          ]
        }
      }
    },
    {
      "message": "Cannot query field \"vatTypes\" on type \"TenantQueries\".",
      "locations": [
        {
          "line": 12,
          "column": 11
        }
      ],
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED",
        "exception": {
          "stacktrace": [
            "GraphQLError: Cannot query field \"vatTypes\" on type \"TenantQueries\".",
            "    at Object.Field (/opt/app/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js:46:31)",
            "    at Object.enter (/opt/app/node_modules/graphql/language/visitor.js:323:29)",
            "    at Object.enter (/opt/app/node_modules/graphql/utilities/TypeInfo.js:370:25)",
            "    at visit (/opt/app/node_modules/graphql/language/visitor.js:243:26)",
            "    at Object.validate (/opt/app/node_modules/graphql/validation/validate.js:69:24)",
            "    at validate (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:221:34)",
            "    at Object.<anonymous> (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:118:42)",
            "    at Generator.next (<anonymous>)",
            "    at fulfilled (/opt/app/node_modules/apollo-server-core/dist/requestPipeline.js:5:58)",
            "    at runMicrotasks (<anonymous>)",
            "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
          ]
        }
      }
    }
  ]
}
    at graphQLFetcher (/home/slaxxarn/projekt/crystallize/examples/products-import-from-csv/utils.js:36:13)
    at process._tickCallback (internal/process/next_tick.js:68:7) 

@hakonkrogh
Copy link
Contributor

Thank you for the feedback, it looks like we forgot to update the example schema for this example. Will get to it asap

@slaxxarn
Copy link
Author

Great, thanx

@hakonkrogh
Copy link
Contributor

Hi @slaxxarn . This should be resolved now after merging #6

@pixelsock
Copy link

Is there a limit to how many product variants can be imported? I'm getting this error:

"error": "{\n "code": "CANNOT_HANDLE_ITEM",\n "message": "Could not create or update item

Also, even though the folder id is the same every import is duplicating and not updating. Any help would be great! Thanks.

@hakonkrogh
Copy link
Contributor

Is there a limit to how many product variants can be imported? I'm getting this error:

"error": "{\n "code": "CANNOT_HANDLE_ITEM",\n "message": "Could not create or update item

Also, even though the folder id is the same every import is duplicating and not updating. Any help would be great! Thanks.

Hi @pixelsock . I suggest heading over to our Slack community, https://crystallizecommunity.slack.com/archives/C01DP46Q410, where we can explore the issues you're facing in detail.

The last issue you are facing can easily be solved by giving the folder an externalReference. Example:

{
  name: "Products",
  externalReference: "products-top-folder",
  ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants