Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Introduce new field type Slug #311

Closed
kbrandwijk opened this issue Jul 16, 2017 · 5 comments
Closed

Introduce new field type Slug #311

kbrandwijk opened this issue Jul 16, 2017 · 5 comments
Labels
status/stale Marked as state by the GitHub stalebot

Comments

@kbrandwijk
Copy link
Contributor

kbrandwijk commented Jul 16, 2017

Thanks to @mwickett for bringing up this functionality on Slack.

Based on the discussion on how to generate a unique slug on a Type, I want to suggest a new field type for this, with a server-side implementation to generate a slug based on a field, which is unique across the Type (default) or across all Types.

type Blog implements Node {
    id: ID!
    title: String!
    slug: Slug! @basedOn(field: 'title') @isUnique
} 

The existing @isUnique tag would indicate a globally unique slug, without it, it would be unique for that Type by default.

@sedubois
Copy link

sedubois commented Jul 16, 2017

The unicity across all types is also discussed in #24.

Relates a bit to last paragraph of #180's OP.

@kbrandwijk
Copy link
Contributor Author

An example implementation is here: prisma-archive/graphcool-templates#24

@stale
Copy link

stale bot commented Jan 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/stale Marked as state by the GitHub stalebot label Jan 9, 2019
@stale stale bot closed this as completed Jan 19, 2019
@IshanKBG
Copy link

IshanKBG commented Oct 2, 2021

Is this feature added

@jacobjove
Copy link

Any word on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/stale Marked as state by the GitHub stalebot
Projects
None yet
Development

No branches or pull requests

6 participants