Giter Site home page Giter Site logo

Comments (14)

jimmylee avatar jimmylee commented on May 5, 2024 1

In that case, be sure to take your time, really think about the problem, and start with instances where we use isomorphic-fetch. You don't have to touch any of the React web components to prove that GraphQL is a better abstraction over using fetch calls.

I also think the standard GraphQL JS lib is fine :)

from directory.

matt-oakes avatar matt-oakes commented on May 5, 2024 1

It looks like from this page of the official docs that you can just make a standard HTTP request, rather than using a library.

This page from the Github v4 GraphQL API docs should have all the details you need, along with the query you posted above. You just need to convert the requests to Javascript rather than the curl examples they give. It will return JSON which you should just be able to use. Should be no need for Apollo or anything more complex.

from directory.

jimmylee avatar jimmylee commented on May 5, 2024 1

@kelset @matt-oakes I've landed: #38, so:

license has been added
fullName has been added
watchers is now subscribers

from directory.

alexbrazier avatar alexbrazier commented on May 5, 2024 1

Fixed by #333

from directory.

jimmylee avatar jimmylee commented on May 5, 2024

I'm a fan of GraphQL and so are the members on our team. So if you want to commit the time to creating a PR to migrating our code over to GraphQL I'm in.

Thanks for thinking about this! Really appreciate you helping us move forward.

from directory.

kelset avatar kelset commented on May 5, 2024

I think you should thank @brentvatne for pointing me to the repo ;)
Anyway glad to hear, I will give it a shot - consider that my experience with actual GraphQL (and React web tbh) is limited to a 48hrs Hackathon so it will probably take me a bit of time to send the actual PR 😇

Any preferences over what to use to parse the data via GraphQL? I think that the standard GraphQL js lib should be enough for querying Github APIv4.

from directory.

matt-oakes avatar matt-oakes commented on May 5, 2024

Hey @kelset!

I have put together PR #38 which implements a new scoring system. One of the rules checks the pushedAt date and awards a bonus for recently updated libraries. This issue currently causes an issue with that rule being incorrectly applied.

Are you currently working on a PR to fix this issue, or is it something that someone else is able to pick up?

from directory.

kelset avatar kelset commented on May 5, 2024

Hi @matt-oakes,
yeah I'm still trying to make it work locally, didn't have enough spare time to complete it yet ><'
Hopefully this weekend I'd be able to submit at least a WIP PR with the "correct" pushedAtinformation your scoring system relies now.

Since we are speaking about it, I think it's worth saying that technically pushedAt is correct: it's GitHub that probably consider that field in a way we can't understand - so instead my idea was having a new field called something like lastCommitDate or lastCommitOnMasterDateand use that instead of pushedAt.

from directory.

matt-oakes avatar matt-oakes commented on May 5, 2024

@kelset Sounds great! I think changing the name of the property to something like lastMasterCommitData is a good idea.

Just so you know, my PR also fixes a few small issues with the Github data:

  1. watchers has been changed to subscribers. This is because "watchers" in the Github API is always the same number as "stargazers". The number of "watchers" at the top of each Github repo is actually called "subscribers" in the API (how straight forward...).
  2. I have added fullName property, which is the repo name in the format react-community/native-directory. This is just to save parsing the githhubUrl again.
  3. You should also be able to get the licence information in a single GraphQL command and avoid the need for the additional API calls that my PR creates.

Details: https://github.com/react-community/native-directory/pull/38/files#diff-b28e04c47986d20caa4ad46f97f50afe

from directory.

kelset avatar kelset commented on May 5, 2024

Quick update: didn't submit the PR 'cause couldn't find a way to do a "single" GraphQl call - most tutorials I've found are all just using Apollo to wrap everything, so yeah I haven't found a way yet 😶. Any link appreciated ;)

from directory.

kelset avatar kelset commented on May 5, 2024

Ok I'm back on track ;)

Finally the awesome guys at Apollo published an article that makes it quite easy for me to understand how to do it :)

I think that adding their apollo-fetch is worth for readability - gonna try to submit a PR tonight :3

from directory.

jimmylee avatar jimmylee commented on May 5, 2024

Nice @kelset -- glad you're still working on this!

If the work is clean, simple and easy to understand, it will definitely land in native.directory! We use GraphQL on expo.io and I wouldn't mind using it here too.

from directory.

kelset avatar kelset commented on May 5, 2024

PR submitted (#50) but it is not completed yet - I preferred to start creating it to be able to discuss it along the way.

from directory.

kelset avatar kelset commented on May 5, 2024

👏👏👏👏👏

from directory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.