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

GraphQL fails when relation field is set to private #4653

Closed
nicecatch opened this issue Dec 4, 2019 · 1 comment · Fixed by #5494
Closed

GraphQL fails when relation field is set to private #4653

nicecatch opened this issue Dec 4, 2019 · 1 comment · Fixed by #5494
Labels
good first issue Good for newcomers issue: bug Issue reporting a bug severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve source: plugin:graphql Source is plugin/graphql package status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@nicecatch
Copy link

nicecatch commented Dec 4, 2019

As title, when using the graphql plugin and marking a relation field as private, the server does not start with this error:

2019-12-04T16:08:46.404Z] error TypeError: Cannot read property 'replace' of undefined
    at isPrimitiveType (C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Aggregator.js:23:22)
    at extractType (C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Aggregator.js:145:10)
    at C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Aggregator.js:282:21
    at C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Aggregator.js:74:26
    at C:\tests\strapi-final-test\node_modules\lodash\lodash.js:914:11
    at C:\tests\strapi-final-test\node_modules\lodash\lodash.js:4905:15
    at baseForOwn (C:\tests\strapi-final-test\node_modules\lodash\lodash.js:2990:24)
    at C:\tests\strapi-final-test\node_modules\lodash\lodash.js:4874:18
    at baseReduce (C:\tests\strapi-final-test\node_modules\lodash\lodash.js:911:5)
    at Function.reduce (C:\tests\strapi-final-test\node_modules\lodash\lodash.js:9681:14)
    at getFieldsByTypes (C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Aggregator.js:70:12)
    at generateConnectionFieldsTypes (C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Aggregator.js:279:27)
    at formatConnectionGroupBy (C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Aggregator.js:316:19)
    at Object.formatModelConnectionsGQL (C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Aggregator.js:486:25)
    at C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Resolvers.js:483:42
    at Array.reduce (<anonymous>)
    at Object.buildShadowCRUD (C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Resolvers.js:281:30)
    at Object.generateSchema (C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\services\Schema.js:137:36)
    at Object.initialize (C:\tests\strapi-final-test\node_modules\strapi-plugin-graphql\hooks\graphql\index.js:59:50)
    at C:\tests\strapi-final-test\node_modules\strapi\lib\hooks\index.js:43:28
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

System

  • Node.js version: 12.13.0
  • Strapi version: 3.0.0-beta.17.8
  • Database: mongodb
  • Operating system: windowds 10 x64
@nicecatch nicecatch changed the title Graphql plugins fails if private: true is set on a relationship field Graphql plugins fails if private: true is set to a relationship field Dec 4, 2019
@nicecatch nicecatch changed the title Graphql plugins fails if private: true is set to a relationship field Graphql plugins fails if private: true is set on a relationship field Dec 4, 2019
@lauriejim
Copy link
Contributor

Please can you well format your message with all required information to be able to reproduce and understand your issue, please.

@lauriejim lauriejim added good first issue Good for newcomers severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve status: confirmed Confirmed by a Strapi Team member or multiple community members issue: bug Issue reporting a bug labels Jan 23, 2020
@lauriejim lauriejim changed the title Graphql plugins fails if private: true is set on a relationship field GraphQL fails when relation field is set to private Feb 11, 2020
@lauriejim lauriejim added the source: plugin:graphql Source is plugin/graphql package label Feb 11, 2020
petersg83 pushed a commit that referenced this issue Mar 12, 2020
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers issue: bug Issue reporting a bug severity: low If the issue only affects a very niche base of users and an easily implemented workaround can solve source: plugin:graphql Source is plugin/graphql package status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants