Graphql 如何仅从我的Github帐户获取公共存储库

Graphql 如何仅从我的Github帐户获取公共存储库,graphql,github-api,Graphql,Github Api,所以我是GraphQL的新手,谁能告诉我如何将下面的代码更改为只从我的帐户检索公共回购 我尝试使用“搜索”属性,但无法使其工作 谢谢 const { github: { repositoryOwner: { repositories: { edges }, }, }, } = useStaticQuery(graphql` { github { repositoryOwner(login: "Sz

所以我是GraphQL的新手,谁能告诉我如何将下面的代码更改为只从我的帐户检索公共回购

我尝试使用“搜索”属性,但无法使其工作

谢谢

  const {
    github: {
      repositoryOwner: {
        repositories: { edges },
      },
    },
  } = useStaticQuery(graphql`
    {
      github {
        repositoryOwner(login: "SzBor") {
          repositories(first: 6, orderBy: { field: CREATED_AT, direction: ASC }) {
            edges {
              node {
                id
                name
                url
                description
              }
            }
          }
        }
      }
    }
  `)

您可以使用
repositories
Ex:

  const {
    github: {
      repositoryOwner: {
        repositories: { edges },
      },
    },
  } = useStaticQuery(graphql`
    {
      github {
        repositoryOwner(login: "SzBor") {
          repositories(first: 6, privacy: PUBLIC, orderBy: { field: CREATED_AT, direction: ASC }) {
            edges {
              node {
                id
                name
                url
                description
              }
            }
          }
        }
      }
    }
  `)

奇怪的是()没有用这些信息更新,但是您可以在上进行测试:)

所以当您执行此操作时,结果是什么?如果有错误,您会收到什么错误?