Skip to content

Instantly share code, notes, and snippets.

@tchak
Last active November 28, 2019 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tchak/22b4cfe792f67e71195d17312cdf8a81 to your computer and use it in GitHub Desktop.
Save tchak/22b4cfe792f67e71195d17312cdf8a81 to your computer and use it in GitHub Desktop.
mutation($dossierId: ID!, $instructeurId: ID!, $body: String!, $attachment: ID) {
dossierEnvoyerMessage(input: {
dossierId: $dossierId,
instructeurId: $instructeurId,
body: $body,
attachment: $attachment
}) {
message {
body
}
}
}

Pour un fichier extraire :

  • filename ex: logo.png
  • byte size ex: 12345
  • checksum ex: rewuryiew6r76wwerwerjri
  • contentType ex: image/png
{
  "query": "<< upload-file.gql >>",
  "variables": {
    "dossierId": "ddsyutd56d567sa5d7fds6f567",
    "filename": "logo.png",
    "byteSize": 12345,
    "checksum": "rewuryiew6r76wwerwerjri",
    "contentType": "image/png"
  }
}

Envoyer le message

{
  "query": "<< envoyer-message.gql >>",
  "variables": {
    "dossierId": "ddsyutd56d567sa5d7fds6f567",
    "instructeurId": "ddf78sd7f8ds8fsd6f7",
    "body": "Bonjour !",
    "attachment": uploadResult.data.createDirectUpload.directUpload.signedBlobId
  }
}
mutation($dossierId: ID!, $filename: String!, $byteSize: Int!, $checksum: String!, $contentType: String!) {
createDirectUpload(input: {
dossierId: $dossierId,
filename: $filename,
byteSize: $byteSize,
checksum: $checksum,
contentType: $contentType
}) {
directUpload {
url
headers
blobId
signedBlobId
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment