Skip to content

Conversation

@interim17
Copy link
Contributor

Problem

Advances #27 and #7 Closes #18

Solution

Ongoing work on schema typing, resolvers, and relationships between entities in gatsby's data layer.

The focus of this pr is making this work:
dataset: MarkdownRemark @link(by: "fields.slug")

The idea is to have a foreign key relationship where one markdown file references another by its slug.

This takes a little bit more work than using the raw string from frontmatter.name but it makes the relationships less brittle. Because the slugs are /directory/filename they are far less likely to run into namespace collisions than a field line name.

Attendant to this I added:

  • slugify as a dependency to help with slugs
  • resolver utils for slugs and software entities
  • vitest and one test suit for the resolver utils
  • New feature (non-breaking change which adds functionality)

@interim17 interim17 changed the title Feature/fk slugs for foreign keys Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants