Comments (14)
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.
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.
@kelset @matt-oakes I've landed: #38, so:
license
has been added
fullName
has been added
watchers
is now subscribers
from directory.
Fixed by #333
from directory.
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.
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.
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.
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" pushedAt
information 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 lastCommitOnMasterDate
and use that instead of pushedAt
.
from directory.
@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:
watchers
has been changed tosubscribers
. 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...).- I have added
fullName
property, which is the repo name in the formatreact-community/native-directory
. This is just to save parsing thegithhubUrl
again. - 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.
from directory.
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.
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.
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.
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.
👏👏👏👏👏
from directory.
Related Issues (20)
- React
- Is @didomi/react-native compatible with Expo Go? HOT 1
- Directory Score doesn't show HOT 5
- [Feature Request] add filtering for `Development Tool` category
- Split expo and expo go HOT 4
- Hi @Daytonshaver140, can you explain the reasoning behind this issue? HOT 1
- King Command HOT 1
- List HOT 1
- Webex compatibility with react-native HOT 4
- Site isn't being updated HOT 1
- Images may get clipped when the lib is the last on the page HOT 1
- search google react native directory HOT 1
- Supports New Architecture flag
- libp2p not compatible with react native expo HOT 1
- Is the Grammarly API compatible with Expo Go?
- Ebad
- Is react-native-bluetooth-escpos-printer compatible with expo go? HOT 3
- ʀᴇᴀᴄᴛ
- Genius Scan SDK Compability HOT 1
- jsonform / react-jsonschema-form (Dynamic Forms from JSON Schema) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from directory.