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
..