Create entries in GraphQL
Hello all
I try to use graphql to read and add objects to Twenty.
I succeeded to get data, ie name, id and methodologies for a given "project" :
And I get:
If I try to create a new project :
It does work for simple fields as name or 1 to 1 relations but not with 1 to many (here the methodologies field could countains several Methodology objects):
Any idea how I can do that?
Thanks !
7 Replies
HI @iero! Glad to see you around
If you want to see graphql query example, you can check your network tab on the frontend
![No description](https://cdn.answeroverflow.com/1261985028833808404/image.png)
It will help get a better understanding on how it should look!
Here you might be confusing the "variables" that are passed to the graphql fields with the "fields" that are the data you want to get back
query MyQuery {
tests(filter: {id: {}, name: {ilike: "a"}}) {
edges {
node {
people {
edges {
node {
city
companyId
createdAt
}
}
}
}
}
}
}
![No description](https://cdn.answeroverflow.com/1261985872350285975/image.png)
the variables are: filter, orderBy, after, before, limit... and filering does not support nested filters at the moment
fields can be nested as far as you want (but careful of performance, every data fetch come at cost)
![No description](https://cdn.answeroverflow.com/1261986194619764736/image.png)
Hello @charles
Thanks for the tip with network, I will play with that and I will post the answer for others when I will get it 🙂