nils

https://github.com/silverstripe/silverstripe-graphql/issues/75

Show 1 attachment(s)
chillu

Allow editing of has_one, has_many and many_many relationships (create, update, delete). Either through inlining into the mutation for the "parent" object, or through separate mutations (e.g. updatePageAddComment, 'updatePageDeleteComment`).

Some drafts from https://github.com/unclecheese|@unclecheese (for a has_one)

types:
  BlogPost:
    fields: [Title, Content, Author] # AuthorID is now implicitly exposed
createPost($Input) { ... }

{
  "Input": {
    "Title": "Some post title",
    "AuthorID": 5 <-- Use an existing author
  }
}
createPost($Input) { ... }

{
  "Input": {
    "Title": "Some post title",
    "Author": { "FirstName": "Uncle", "Surname": "Cheese" } <--- Creates a new author
  }
}
createPost($Input) { ... }

{
  "Input": {
    "Title": "Some post title",
    "Author": { "ID": 5, "FirstName": "Aunty", "Surname": "Crackers" } <--- Throws. ID is never mutable
  }
}
createPost($Input) { ... }

{
  "Input": {
    "Title": "Some post title",
    "AuthorID": 5,
    "Author": { "FirstName": "Aunty", "Surname": "Crackers" } <--- Creates post, updates Author.
  }
}

See prior discussion at https://github.com/silverstripe/silverstripe-graphql/issues/67|#67

Hide attachment content
nils

I can add a new mutation but would have been nice to do it all with one query when creating the record

nils

@robbieaverill works great for reading but not for updating relations

nils

Is there any scaffolding for handling has_many and many_many relations?

nils

but for now you'll get the whole folder structure as if you were using a local folder

nils

I think search in files will work soon as well, pending a Code update

nils

@Hels this one works pretty well for Visual Studio Code: https://marketplace.visualstudio.com/items?itemName=liximomo.remotefs

Show 1 attachment(s)
marketplace.visualstudio.com  
Remote FS - Visual Studio Marketplace

Extension for Visual Studio Code - Working with any file in everywhere like they are in local with vscdoe.

Hide attachment content
nils

I'm building a little highscore system for a new game next week, can see if I'm allowed to put on GitHub

nils

might want to save data and stuff as well