* 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>
* Fix#10125 - accept falsy values returned by controllers
* Add test for falsy ctx.body on built graphql resolver
* Use test instead of it in unit tests
* Added privateAttributes globally and per model
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Added tests for sanitizeEntity
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Fixed broken test
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Added privateAttributes to GraphQL responses
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Added docs for privateAttributes
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Refactored and fixed PR comments
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Merged tests and fixed broken tests from merge
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Updated documentation for new option
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Refactored GraphQL implementation
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Fixed PR comments
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Fixed tests for sanitize-entity
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Removed code and tests for ignorePrivateFor
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Exported getPrivateAttributes for GraphQL plugin
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
* Removed ignorePrivateFor from docs
Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
a required attribute that has a default value it's now not required in the input schema used for entities creation
Signed-off-by: Gadi Piperno Corcos <gadi@skyriseltd.com>
Co-authored-by: Gadi Piperno Corcos <gadi@skyriseltd.com>
* Add info to custom resolvers, add formatError to GraphQL service
Signed-off-by: harimkims <harimkims@gmail.com>
* remove format-error service and use config instead
Signed-off-by: harimkims <harimkims@gmail.com>
* fix shadow crud breaking build when resolvers are not defined in a plugin
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
* refacto
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
Co-authored-by: Pierre Noël <pierre.noel@strapi.io>