dyne / zenpub

Reflow federated economic network
GNU Affero General Public License v3.0
13 stars 3 forks source link

How to upload image for a Resource? #54

Closed viktorsmari closed 2 years ago

viktorsmari commented 3 years ago

We are able to upload a Profile picture and background image in the settings without problems :+1: 2021-06-08_18-02-22

We are having issues with doing the exact same thing for a Resource 2021-06-08_18-00-21

Should it work the same way?

To update the economic resource, we get this mutation: But the image type is only a URI.

mutation updateEconomicResource (
    $id: ID!,
    $note: String,
    $image: URI,
) {
    updateEconomicResource (
        resource: {
            id: $id,
            note: $note,
            image: $image,
        }
    ) {
        economicResource {
           id
        }
    }
}

For example , when we change user profile, we use this mutation:

mutation meUpdateMyProfile($profile:UpdateProfileInput!, $icon: UploadInput, $image: UploadInput) {
  updateProfile(profile:$profile, icon: $icon, image: $image){
    user {
      id
      name
      icon{ id, url },
      image{ id, url },
      location,
      summary,
      displayUsername,
      website,
      extraInfo
    }
  }
}

When we try to send a file, we get console errors:

2021-06-08_18-04-43

oksanasalohubova commented 2 years ago

This ticket was checked against the BonFire API. Resolution: We haven't ability to upload files anywhere Details See the screenshot with available queries in BonFire:

This screen show ZenPub API create user. Here we can upload file

Снимок экрана 2021-10-21 в 12 23 50

This screen show BonFire API update Resource. Here we have no ability to upload file, only string URI for image field

Снимок экрана 2021-10-21 в 12 23 37

This screen show BonFire Api user create. As you can see, we have not ability to upload image also. May be we need new ticket for this issue?

Снимок экрана 2021-10-21 в 12 22 44
adam-burns commented 2 years ago

This is correct behaviour for both back ends. Please note image{ id, url }, that the schema requires a url pointer to an image, not an image itself.

pral2a commented 2 years ago

Please, see point 3 in #67 and provide a clear answer about the development roadmap. We know about the schema, we are only trying to confirm the development roadmap.