graphql-kit / graphql-faker

🎲 Mock or extend your GraphQL API with faked data. No coding required.
MIT License
2.69k stars 225 forks source link

add new @fake function: unplashUrl #107

Closed Kageetai closed 4 years ago

IvanGoncharov commented 4 years ago

@Kageetai Thanks for PR 👍 It looks like faker.js natively support unsplash we just need to use it instead of current provider: https://github.com/Marak/faker.js/blob/acfbf3becde772adf4f6bf63bb1897a37ebddd3a/lib/image_providers/unsplash.js Can you please test it and switch the existing imageUrl to it?

Kageetai commented 4 years ago

@IvanGoncharov Yes, I saw that, but it doesn't seem to be usable yet: faker.image.unsplash or so does not work, although it looks like it should according this line: https://github.com/Marak/faker.js/blob/acfbf3becde772adf4f6bf63bb1897a37ebddd3a/lib/image.js#L220

Something about how this is bound here: https://github.com/Marak/faker.js/blob/acfbf3becde772adf4f6bf63bb1897a37ebddd3a/lib/index.js#L76

I didn't wanna investigate too much, also faker does not seem to respond to PRs that much, so I created this PR, also so I can already test it in our project

IvanGoncharov commented 4 years ago

I switched imageUrl to unsplash in 682affd21b1d86cadd6d096b32ab6fe971503067

Kageetai commented 4 years ago

Nice, will you also publish this to NPM soon?

IvanGoncharov commented 4 years ago

@Kageetai Released as graphql-faker@2.0.0-rc.18 🎉

Kageetai commented 4 years ago

Awesome, thanks a lot!