docs icon indicating copy to clipboard operation
docs copied to clipboard

docs: add defined schema docs

Open Moumouls opened this issue 3 years ago • 9 comments

Add defined schema docs.

See #872

Moumouls avatar Feb 20 '22 12:02 Moumouls

@sadortun if you want to take a look, feel to suggest some commit changes from github UI 🙂

Moumouls avatar Feb 20 '22 12:02 Moumouls

@sadortun @mtrezza requested changes performed. Feel free to use the Github commit suggestion feature if you some new changes suggestions, then i can apply easily your changes :)

Moumouls avatar Mar 05 '22 09:03 Moumouls

@sadortun i added bold, @mtrezza since Parse V5 was released, what do you think about merging this one ?

Moumouls avatar Mar 18 '22 10:03 Moumouls

Maybe not the best place to ask but as there is no official documentation available yet:

  • Can we define on schema levels Array of Pointers of a specific class? This PR does not mention this and from some tests it seems that if you specify Array as type in the schema, anything is accepted as array content.
  • It would be nice if the documentation could include some examples on how to use beforeMigration and afterMigration hooks. I am not sure how I could leverage them to migrate data.

stephannielsen avatar May 02 '22 14:05 stephannielsen

Thanks for the feedback to the docs, maybe @Moumouls can add this to the PR? To your first point, the best place to ask is our community forum.

mtrezza avatar May 02 '22 16:05 mtrezza

thanks, @stephannielsen for your feedback I'll quickly answer to your question. Parse is not currently able to type the content of Array. Anything could be stored in the Array. You can use the beforeSave Parse Cloud hook to prevent users saving anything other than the desired pointers.

If you use the GraphQL API. You can use the "inline fragment" graphql feature to automatically get data from the pointer array.

https://community.parseplatform.org/t/type-arrayresult-must-have-a-selection-of-subfields-error/847/2?u=moumouls

for example ... on MyPointerClass { id aField}

Moumouls avatar May 02 '22 16:05 Moumouls

Thanks @Moumouls and @mtrezza for your quick replies.

I already expected that Parse can't type array fields and that triggers would allow me to validate incoming data. Thanks for the quick confirmation.

stephannielsen avatar May 02 '22 19:05 stephannielsen

Hey, just had a quick question, since the documentation isn't updated yet. Can we have unique indexes according to the recent merge?

Thanks.

RahulLanjewar93 avatar May 12 '22 07:05 RahulLanjewar93

If anyone wants to pick up and finish this PR (see the review comments, just grammar and style corrections), please feel free to do so, so we can merge this chapter about defined schema into the docs. You will probably have to open a new PR, then we can close this one.

I have added a description to this PR and created issue #872 to track this.

mtrezza avatar May 12 '22 09:05 mtrezza

@mtrezza any chance to update your comments using the commit suggestion feature ? then I'll be happy to apply all your suggestions 🚀

Moumouls avatar Nov 14 '22 23:11 Moumouls

closing in favor of https://github.com/parse-community/docs/pull/912

Moumouls avatar Dec 24 '22 13:12 Moumouls