Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stitch teams, projects and files together #22

Merged
merged 4 commits into from
May 26, 2019
Merged

Conversation

braposo
Copy link
Owner

@braposo braposo commented May 26, 2019

This brings teams, projects and files together so we can go get all properties available on each file for the entire team/project.

It enables some really interesting things for organisations and allows them to do things like:

{
  projects(teamId: "707291103567524770") {
    id
    name
    files {
      name
      pages {
        name
      }
    }
  }
}

to get the names of the pages in all files inside a team:

{
  "data": {
    "projects": [
      {
        "id": "2482679",
        "name": "Design System",
        "files": [
          {
            "name": "Figma GraphQL",
            "pages": [
              {
                "name": "Assets"
              },
              {
                "name": "GraphQL Conf Presentation"
              }
            ]
          },
          {
            "name": "Figma-GraphQL Colors",
            "pages": [
              {
                "name": "Page 1"
              }
            ]
          },
          {
            "name": "Wûnderzin UI Kit",
            "pages": [
              {
                "name": "pages"
              },
              {
                "name": "preview modules"
              },
              {
                "name": "base modules"
              },
              {
                "name": "article modules"
              },
              {
                "name": "forms"
              },
              {
                "name": "controls"
              },
              {
                "name": "icons"
              },
              {
                "name": "styles"
              }
            ]
          }
        ]
      },
      {
        "id": "2482707",
        "name": "Test",
        "files": [
          {
            "name": "Simple Test",
            "pages": [
              {
                "name": "Page 1"
              }
            ]
          },
          {
            "name": "Untitled",
            "pages": [
              {
                "name": "Page"
              }
            ]
          },
          {
            "name": "figma-graphql test file",
            "pages": [
              {
                "name": "Page 1"
              },
              {
                "name": "Page 2"
              }
            ]
          }
        ]
      }
    ]
  }
}

We can also do a similar query for the project files directly:

{
  projectFiles(projectId: "2482707") {
    name
    pages {
      name
    }
  }
}

Fixes #4

@codecov-io
Copy link

Codecov Report

Merging #22 into master will decrease coverage by 3.25%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
- Coverage   82.44%   79.18%   -3.26%     
==========================================
  Files          22       22              
  Lines         188      197       +9     
  Branches       14       13       -1     
==========================================
+ Hits          155      156       +1     
- Misses         28       37       +9     
+ Partials        5        4       -1
Impacted Files Coverage Δ
src/utils/helpers.js 100% <ø> (+50%) ⬆️
src/utils/nodes.js 67.64% <100%> (ø) ⬆️
src/utils/figma.js 100% <100%> (ø) ⬆️
src/types/file.js 100% <100%> (ø) ⬆️
src/types/node.js 52% <22.22%> (-8%) ⬇️
src/types/projects.js 40% <25%> (-35%) ⬇️
src/types/project-files.js 50% <25%> (-25%) ⬇️
src/types/image.js 62.5% <50%> (ø) ⬆️
src/types/comments.js 60% <50%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e86ef1...46bc8fd. Read the comment docs.

@braposo braposo merged commit 17687bc into master May 26, 2019
@braposo braposo deleted the stitch-projects branch May 26, 2019 23:31
@braposo
Copy link
Owner Author

braposo commented May 26, 2019

🎉 This PR is included in version 1.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Embed Team -> Project[] -> File[]
2 participants