drupal-graphql/graphql-mutation

URL Alias not working

frontendgineer opened this issue · 1 comments

Hi,

I've enabled the Pathauto and Token module > Added Pathauto Pattern (Pattern Type: Content, Path Pattern: [node:title], Content Type: Article, Enabled: Yes)

I created a node Article using graphql mutation. Node Article was created, but the URL alias was not created.

Tested on Explorer asf:

mutation {
createNodeArticle (input:{title:"Starwars 3", body: {value:"Starwars World"}}){
entity{
...on NodeArticle {
nid
title
body{
value
},
entityUrl{
alias
path
}
}
}
}
}

Result:

{
"data": {
"createNodeArticle": {
"entity": {
"nid": 65,
"title": "Starwars 3",
"body": {
"value": "Starwars World"
},
"entityUrl": {
"alias": "/node/65",
"path": "/node/65"
}
}
}
}
}

fubhy commented

That's because this is a feature of the pathauto module and the node save FORM. We are not going via the form and never will. Sorry! For this to work you would have to manually create a mutation.