4 Commits

Author SHA1 Message Date
Ralph
81a9a63cad
GraphQL Plugin (bug): Content type's attributes marked as private are being exposed in the exported GraphQL schema (#9805)
* Fixes #9804

* Fixes isPrivateAttribute function in strapi utils to take into account the private property within an attribute

* removing comment

* removing isNotPrivate function + adding call to already existing isPrivateAttribute function instead of isNotPrivate

* isPrivateAttribute fixed based on coments from Alexandre and confirmed that the model does indeed contain all private fields in an array at startup time

* removing isNotPrivate function and fixing generateEnumDefinitions to use the already available isPrivateAttribute function

* checking if created_at and update_at are also marked as private and if this is the case then hiding them

* allowIds by default when generating the input model to see if the tests will pass

* moving allowIds back to false by default

* adding isTypeAttributeEnabled function to check if a type attribute has been disabled and remove it from the exported graphql schema

* removing unused var

* only using isTypeAttributeEnabled instead of isPrivateAttribute.

* adding isPrivateAttribute at association level

* Adding isNotPrivate back together with isTypeAttributeEnabled

* adding unit test for removing a disabled attribute from a graphql schema

* renaming person to player in the test model

* Deleting the file as it has been renamed in the strapi master branch

* fixing lint issues

* fixing some lint issues

* adding isTypeAttributeEnabled support

* adding enumeration field in graphql

* adding use strict; to test file

* fixing test checking that disabled attributes in graphql are removed from the graphql schema

* adding test for buidShadowCrud

* Update packages/strapi-plugin-graphql/services/type-builder.js

Co-authored-by: Jean-Sébastien Herbaux <jean-sebastien.herbaux@epitech.eu>

Co-authored-by: Rmaroun <rmaroun@outlook.com>
Co-authored-by: Jean-Sébastien Herbaux <jean-sebastien.herbaux@epitech.eu>
2021-05-10 09:35:07 +02:00
Alexandre Bodin
387b53bf35 Target shadowcrud mutations only 2021-04-14 17:14:45 +02:00
Alexandre Bodin
773069f7c5 Remove unnecessary code 2021-04-09 10:46:10 +02:00
Alexandre Bodin
02342ace0a Use objects instead of strings to declare queries & mutattions 2021-04-08 13:26:03 +02:00