-
Notifications
You must be signed in to change notification settings - Fork 100
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
Unique slug generation #24
Comments
Hey Mike, thanks a lot for putting this out here, this is exactly the kind of example I'd like to see in this repository! 😄 I think a transform function fits better, but you can also implement this with a Schema Extension function.
This is perfectly fine! The way I approached this in other examples is by providing a I'd love to collaborate on this! Maybe we can add another variant to the |
Hey Nilan,
Thanks for looking at this. I'd love to collaborate on this with you.
I'm away this weekend and back at it on Monday.
I'll draft an example schema to go with this and post. There are probably
some things we can do to abstract this a bit for more use cases. Also
documenting with some places where others may need to modify would probably
be good.
…On July 22, 2017 at 13:41:36, Nilan Marktanner ***@***.***) wrote:
Hey Mike, thanks a lot for putting this out here, this is exactly the kind
of example I'd like to see in this repository! 😄
I think a transform function fits better, but you can also implement this
with a Schema Extension function.
It also needs to be adjusted heavily based on the particular project
schema and naming etc.
This is perfectly fine! The way I approached this in other examples is by
providing a example.graphql schema file that can be used with the
Graphcool CLI to bootstrap a project with the right structure. This way,
you have something working quite fast that you can hopefully adjust easily
to your own use case.
I'd love to collaborate on this! Maybe we can add another variant to the
generate-slug, or add this as a new example advanced-generate-slug or
similar?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAzon36RmYJDfP5GD3vfLcCFW5hzR2-hks5sQjRQgaJpZM4OaKyG>
.
|
With the help of @kbrandwijk (thank you!), I've got a much more robust slug function that seems to be working well and handling every case (that I've thought of yet).
title
value from a new record, slugifies it (using slugs, rather than regex. Handles far more inputs - unicode, other language characters, etc.))-n+1
to the end. (e.g.title-of-post-1, title-of-post-2
I feel like this could be implemented as a schema extension as well, although I'm fairly new to that, so may be wrong.
It also needs to be adjusted heavily based on the particular project schema and naming etc.
I'm putting this in as an issue to look for guidance on whether this is worth writing up an including in these function examples. And should it be a Schema extension rather than a transform function?
The text was updated successfully, but these errors were encountered: