Skip to content

Latest commit

 

History

History
42 lines (41 loc) · 1.57 KB

README.md

File metadata and controls

42 lines (41 loc) · 1.57 KB

mesh-directus-replication

A temporary project to replicate the errors when connected to Directus.

Setup

  1. Run yarn install
  2. Set ADMIN_EMAIL and ADMIN_PASSWORD in docker-compose.yml
    • This will be your login to Directus
  3. Run docker-compose up
  4. Navigate to Directus at http://localhost:8055 and login
  5. Click the user icon in bottom left corner.
  6. Scroll to bottom and set "Token" (Click check mark at top to save)
  7. Open .meshrc.yaml and put the "Token" value you chose after "Bearer"
    • e.g. Authorization: Bearer ThisIsMyToken
  8. Navigate back to Directus and click the "Gear" icon, followed by "Data Model" in left hand menu.
  9. Create 3 data models in total.
    • e.g. lesson, video, article
    • Don't worry about selecting anything, just click through after naming table
  10. For each data model, click "Create Field" and add a "Standard field" (just provide a name and click through).
  11. Create a "Many to Any" field on lesson data model named steps, with allowed relations of video and article.
  12. Click the "Box" icon in left hand menu and create a record for every data model (collection)
  13. For the course record, add the lesson and article record as steps.
  14. Run yarn graphql-mesh serve
  15. Query for
{
  items {
    lesson {
      steps {
        item {
          ... on video {
            title
          }
          ... on article {
            title
          }
        }
      }
    }
  }
}
  1. Uncomment each transform one at a time in .meshrc.yaml and re-run the above query (with necessary adjustments) to observe the errors.