Git Product home page Git Product logo

Comments (3)

kosirm avatar kosirm commented on June 13, 2024 1

Oh, man, that's revelation for me, didn't know it's possible at all...
Thank you so much for the info and for your time! 😄
👍

from gatsby-source-github-api.

ldd avatar ldd commented on June 13, 2024

So! I am not sure if I understand you correctly, but let me give you an example:

https://github.com/ldd/gatsby-starter-github-portfolio/blob/master/gatsby-config.js

In there, I use the graphQL API to access the readme.md text. In that same project, I use some cute tricks to find the first image in the text, etc.

Anyways, if your question is "can I access the code saved in github"? The answer is yes, for sure!

I can even add a little section on how to do it because it is not 100% clear. (It took me some time to find it)

Otherwise, you may have a more complicated question, but if you clarify it, I can surely try to help!

from gatsby-source-github-api.

ldd avatar ldd commented on June 13, 2024

further comment for anybody who sees this:

query { 
  user( login: "ldd") { 
    repositories(first: 11){
      edges {
        node {
          readme: object(expression:"master:package.json"){
                    ... on Blob{
                      text
                    }
                  }
        }
      }
    }
  }
}

That'll get you the package.json contents for some of my repositories.

Sources: https://stackoverflow.com/questions/44137710/github-graphql-equivalent-of-the-contents-api

from gatsby-source-github-api.

Related Issues (15)

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.