Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to upload image for a Resource? #54

Closed
viktorsmari opened this issue Jun 8, 2021 · 3 comments
Closed

How to upload image for a Resource? #54

viktorsmari opened this issue Jun 8, 2021 · 3 comments

Comments

@viktorsmari
Copy link

viktorsmari commented Jun 8, 2021

We are able to upload a Profile picture and background image in the settings without problems 👍
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
Copy link

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
Copy link
Member

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
Copy link

pral2a commented Oct 22, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants