{"action":"created","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/7769","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/7769/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/7769/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/7769/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/7769","id":355889609,"node_id":"MDU6SXNzdWUzNTU4ODk2MDk=","number":7769,"title":"[v2] GraphQL results sorting","user":{"login":"oltodo","id":483842,"node_id":"MDQ6VXNlcjQ4Mzg0Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/483842?v=4","gravatar_id":"","url":"https://api.github.com/users/oltodo","html_url":"https://github.com/oltodo","followers_url":"https://api.github.com/users/oltodo/followers","following_url":"https://api.github.com/users/oltodo/following{/other_user}","gists_url":"https://api.github.com/users/oltodo/gists{/gist_id}","starred_url":"https://api.github.com/users/oltodo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oltodo/subscriptions","organizations_url":"https://api.github.com/users/oltodo/orgs","repos_url":"https://api.github.com/users/oltodo/repos","events_url":"https://api.github.com/users/oltodo/events{/privacy}","received_events_url":"https://api.github.com/users/oltodo/received_events","type":"User","site_admin":false},"labels":[{"id":214544677,"node_id":"MDU6TGFiZWwyMTQ1NDQ2Nzc=","url":"https://api.github.com/repos/gatsbyjs/gatsby/labels/type:%20question%20or%20discussion","name":"type: question or discussion","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-31T08:37:23Z","updated_at":"2018-08-31T10:11:11Z","closed_at":null,"author_association":"NONE","body":"When I've migrated to the v2 of Gatsby, I get some troubles. The project I'm working on is deployed on a pool of multiple load-balancing servers. So it's builded as many times as there are servers. But I realized that each of this builds wasn't exactly the same. One of the `public`'s folder generated files didn't have the same hash from one server to another.\r\n\r\nSo by seeing a diff on this files — supposed to be the same — I realized they contain the page list which were not in the same order.\r\n\r\nRummaging a little I came to understand that my GraphQL query, executed into the `createPages` function of the `gatsby-node.js` file, didn't return the data in the same order from once to another. So I had to add a `sort` filter into the query to ensure always getting the same order.\r\n\r\nI wonder if it seems to be normal that the same query, with the same data, result with a different order for each execution when the `sort` filter is not specified.\r\n\r\n__Edit:__\r\n\r\nActually adding a `sort` filter on my GraphQL query didn't totally fix the problem. It correctly fixed the order into `pages` reducer but not into the `jsonDataPaths`. After investigating it seems to be due to async execution of the `queueRunner` tasks into the [query-queue.js](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/internal-plugins/query-runner/query-queue.js#L45) file. How do you think it can be resolved?"},"comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments/417619183","html_url":"https://github.com/gatsbyjs/gatsby/issues/7769#issuecomment-417619183","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/7769","id":417619183,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzYxOTE4Mw==","user":{"login":"pieh","id":419821,"node_id":"MDQ6VXNlcjQxOTgyMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/419821?v=4","gravatar_id":"","url":"https://api.github.com/users/pieh","html_url":"https://github.com/pieh","followers_url":"https://api.github.com/users/pieh/followers","following_url":"https://api.github.com/users/pieh/following{/other_user}","gists_url":"https://api.github.com/users/pieh/gists{/gist_id}","starred_url":"https://api.github.com/users/pieh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pieh/subscriptions","organizations_url":"https://api.github.com/users/pieh/orgs","repos_url":"https://api.github.com/users/pieh/repos","events_url":"https://api.github.com/users/pieh/events{/privacy}","received_events_url":"https://api.github.com/users/pieh/received_events","type":"User","site_admin":false},"created_at":"2018-08-31T10:11:11Z","updated_at":"2018-08-31T10:11:11Z","author_association":"CONTRIBUTOR","body":"If sort isn't specified, data order will be same as node created by plugins. It can differ between independent builds if:\r\n- source plugin pull data and create data nodes in parallel\r\n- you already have cache in one of build servers in one of your server\r\n\r\nWhat source plugin do you use?"}}
{"actor":{"display_login":"pieh"}}