{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/210554597","pull_request_review_id":146792641,"id":210554597,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDU1NDU5Nw==","diff_hunk":"@@ -0,0 +1,206 @@\n+/*\n+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n+ * or more contributor license agreements. Licensed under the Elastic License;\n+ * you may not use this file except in compliance with the Elastic License.\n+ */\n+\n+import { ApolloError, ApolloQueryResult } from 'apollo-client';\n+import { DocumentNode } from 'graphql';\n+import { Action as ReduxAction } from 'redux';\n+import { Epic } from 'redux-observable';\n+import { from, merge, Observable, pipe } from 'rxjs';\n+import { catchError, filter, map, startWith, switchMap, withLatestFrom } from 'rxjs/operators';\n+import { Action, ActionCreator, actionCreatorFactory, Failure, Success } from 'typescript-fsa';\n+import { reducerWithInitialState } from 'typescript-fsa-reducers';\n+\n+import { createSelector } from 'reselect';\n+import { InfraApolloClient } from '../../lib/lib';\n+import {\n+  isFailureLoadingResult,\n+  isIdleLoadingProgress,\n+  isRunningLoadingProgress,\n+  isSuccessLoadingResult,\n+  isUninitializedLoadingResult,\n+  LoadingPolicy,\n+  LoadingProgress,\n+  LoadingResult,\n+} from '../loading_state';\n+\n+export interface GraphqlState<State> {\n+  current: LoadingProgress<OperationInfo<any>>;\n+  last: LoadingResult<OperationInfo<any>>;\n+  data: State | undefined;\n+}\n+\n+interface OperationInfo<Variables> {\n+  operationKey: string;\n+  variables: Variables;\n+}\n+\n+type ResolveDonePayload<Variables, Data> = Success<Variables, ApolloQueryResult<Data>>;\n+type ResolveFailedPayload<Variables, Error> = Failure<Variables, Error>;\n+\n+interface OperationActionCreators<Data, Variables, Error = ApolloError> {\n+  resolve: ActionCreator<Variables>;\n+  resolveStarted: ActionCreator<Variables>;\n+  resolveDone: ActionCreator<ResolveDonePayload<Variables, Data>>;\n+  resolveFailed: ActionCreator<ResolveFailedPayload<Variables, Error>>;\n+}\n+\n+export const createGraphqlInitialState = <State>(initialData?: State): GraphqlState<State> => ({\n+  current: {\n+    progress: 'idle',","path":"x-pack/plugins/infra/public/utils/remote_state/remote_graphql_state.ts","position":52,"original_position":52,"commit_id":"ad4f34ffa6d9a20fb8398c96119c3e519db6625f","original_commit_id":"3569ae5d665fd258525357fe4a858676dd2fbe4d","user":{"login":"skh","id":189073,"node_id":"MDQ6VXNlcjE4OTA3Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/189073?v=4","gravatar_id":"","url":"https://api.github.com/users/skh","html_url":"https://github.com/skh","followers_url":"https://api.github.com/users/skh/followers","following_url":"https://api.github.com/users/skh/following{/other_user}","gists_url":"https://api.github.com/users/skh/gists{/gist_id}","starred_url":"https://api.github.com/users/skh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skh/subscriptions","organizations_url":"https://api.github.com/users/skh/orgs","repos_url":"https://api.github.com/users/skh/repos","events_url":"https://api.github.com/users/skh/events{/privacy}","received_events_url":"https://api.github.com/users/skh/received_events","type":"User","site_admin":false},"body":"If this is loading state, could it be named something with `loading`? `progress` makes me think of a 0-100% range or something similar and I believe we don't have that.","created_at":"2018-08-16T10:58:47Z","updated_at":"2018-08-16T10:58:47Z","html_url":"https://github.com/elastic/kibana/pull/21706#discussion_r210554597","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/21706","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/210554597"},"html":{"href":"https://github.com/elastic/kibana/pull/21706#discussion_r210554597"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/21706"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/21706","id":206527279,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NTI3Mjc5","html_url":"https://github.com/elastic/kibana/pull/21706","diff_url":"https://github.com/elastic/kibana/pull/21706.diff","patch_url":"https://github.com/elastic/kibana/pull/21706.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/21706","number":21706,"state":"open","locked":false,"title":"[Infra UI] Consume log entry graphql api in the client","user":{"login":"weltenwort","id":973741,"node_id":"MDQ6VXNlcjk3Mzc0MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/973741?v=4","gravatar_id":"","url":"https://api.github.com/users/weltenwort","html_url":"https://github.com/weltenwort","followers_url":"https://api.github.com/users/weltenwort/followers","following_url":"https://api.github.com/users/weltenwort/following{/other_user}","gists_url":"https://api.github.com/users/weltenwort/gists{/gist_id}","starred_url":"https://api.github.com/users/weltenwort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weltenwort/subscriptions","organizations_url":"https://api.github.com/users/weltenwort/orgs","repos_url":"https://api.github.com/users/weltenwort/repos","events_url":"https://api.github.com/users/weltenwort/events{/privacy}","received_events_url":"https://api.github.com/users/weltenwort/received_events","type":"User","site_admin":false},"body":"## New Redux GraphQL helpers\r\n\r\nThe `utils/remote_state/remote_graphql_state.ts` file in the client-side code exports a few functions to help with creating redux entities backed by GrahphQL queries:\r\n\r\n* `createGraphqlInitialState<State>(initialState: State)` to create the basic state structure derived from a generated GraphQL query result\r\n* `createGraphqlOperationActionCreators()` to create actions creators relating to those queries\r\n* `createGraphqlOperationReducer()` to create a reducer for the action creators\r\n* `createGraphqlQueryEpic()` to create an redux-observable epic that manages the side-effects required to resolve the query\r\n* `createGraphqlStateSelectors()` to create a set of selectors to inspect the state and results of the query\r\n\r\nThe `entries` slice is the first example of usage. (see below)\r\n\r\n## Redux store changes\r\n\r\n### `entries` slice\r\n\r\nThe `entries` slice of the redux state now has an `entries` key that is managed by the GraphQL helpers described above. It defines two queries:\r\n\r\n* `load` to load and replace the set of entries returned via the `Query.source.logEntriesAround` fields\r\n* `load_more` to load and append more entries to a set of entries already present in the state\r\n\r\n## Known Limitations and follow-up tasks\r\n\r\nThis PR has several known limitations:\r\n\r\n* [ ] when loading more entries, old entries are not forgotten anymore until a full reload\r\n* [ ] the summary loading mechanism still uses hardcoded indices and fields via the old ReST api (PR #21859)\r\n* [ ] syncing the scroll position to the url is broken\r\n* [ ] search is broken, because it still uses the old ReST api (disabled in PR #21935 )\r\n* [ ] live streaming is broken (PR #22008 )","created_at":"2018-08-06T21:55:28Z","updated_at":"2018-08-16T10:58:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c1a503fa88c306e51ca9b9fcb1045035250511c","assignee":{"login":"weltenwort","id":973741,"node_id":"MDQ6VXNlcjk3Mzc0MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/973741?v=4","gravatar_id":"","url":"https://api.github.com/users/weltenwort","html_url":"https://github.com/weltenwort","followers_url":"https://api.github.com/users/weltenwort/followers","following_url":"https://api.github.com/users/weltenwort/following{/other_user}","gists_url":"https://api.github.com/users/weltenwort/gists{/gist_id}","starred_url":"https://api.github.com/users/weltenwort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weltenwort/subscriptions","organizations_url":"https://api.github.com/users/weltenwort/orgs","repos_url":"https://api.github.com/users/weltenwort/repos","events_url":"https://api.github.com/users/weltenwort/events{/privacy}","received_events_url":"https://api.github.com/users/weltenwort/received_events","type":"User","site_admin":false},"assignees":[{"login":"weltenwort","id":973741,"node_id":"MDQ6VXNlcjk3Mzc0MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/973741?v=4","gravatar_id":"","url":"https://api.github.com/users/weltenwort","html_url":"https://github.com/weltenwort","followers_url":"https://api.github.com/users/weltenwort/followers","following_url":"https://api.github.com/users/weltenwort/following{/other_user}","gists_url":"https://api.github.com/users/weltenwort/gists{/gist_id}","starred_url":"https://api.github.com/users/weltenwort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weltenwort/subscriptions","organizations_url":"https://api.github.com/users/weltenwort/orgs","repos_url":"https://api.github.com/users/weltenwort/repos","events_url":"https://api.github.com/users/weltenwort/events{/privacy}","received_events_url":"https://api.github.com/users/weltenwort/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":983061515,"node_id":"MDU6TGFiZWw5ODMwNjE1MTU=","url":"https://api.github.com/repos/elastic/kibana/labels/:Infra%20UI","name":":Infra UI","color":"6cddd6","default":false},{"id":981817023,"node_id":"MDU6TGFiZWw5ODE4MTcwMjM=","url":"https://api.github.com/repos/elastic/kibana/labels/:Ingest%20UI","name":":Ingest UI","color":"c5def5","default":false},{"id":1019679732,"node_id":"MDU6TGFiZWwxMDE5Njc5NzMy","url":"https://api.github.com/repos/elastic/kibana/labels/loe:week","name":"loe:week","color":"F98510","default":false},{"id":135307740,"node_id":"MDU6TGFiZWwxMzUzMDc3NDA=","url":"https://api.github.com/repos/elastic/kibana/labels/review","name":"review","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/21706/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/21706/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/21706/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/ad4f34ffa6d9a20fb8398c96119c3e519db6625f","head":{"label":"weltenwort:infra-ui-enhancement-graphql-logentry-container","ref":"infra-ui-enhancement-graphql-logentry-container","sha":"ad4f34ffa6d9a20fb8398c96119c3e519db6625f","user":{"login":"weltenwort","id":973741,"node_id":"MDQ6VXNlcjk3Mzc0MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/973741?v=4","gravatar_id":"","url":"https://api.github.com/users/weltenwort","html_url":"https://github.com/weltenwort","followers_url":"https://api.github.com/users/weltenwort/followers","following_url":"https://api.github.com/users/weltenwort/following{/other_user}","gists_url":"https://api.github.com/users/weltenwort/gists{/gist_id}","starred_url":"https://api.github.com/users/weltenwort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weltenwort/subscriptions","organizations_url":"https://api.github.com/users/weltenwort/orgs","repos_url":"https://api.github.com/users/weltenwort/repos","events_url":"https://api.github.com/users/weltenwort/events{/privacy}","received_events_url":"https://api.github.com/users/weltenwort/received_events","type":"User","site_admin":false},"repo":{"id":70486693,"node_id":"MDEwOlJlcG9zaXRvcnk3MDQ4NjY5Mw==","name":"kibana","full_name":"weltenwort/kibana","owner":{"login":"weltenwort","id":973741,"node_id":"MDQ6VXNlcjk3Mzc0MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/973741?v=4","gravatar_id":"","url":"https://api.github.com/users/weltenwort","html_url":"https://github.com/weltenwort","followers_url":"https://api.github.com/users/weltenwort/followers","following_url":"https://api.github.com/users/weltenwort/following{/other_user}","gists_url":"https://api.github.com/users/weltenwort/gists{/gist_id}","starred_url":"https://api.github.com/users/weltenwort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weltenwort/subscriptions","organizations_url":"https://api.github.com/users/weltenwort/orgs","repos_url":"https://api.github.com/users/weltenwort/repos","events_url":"https://api.github.com/users/weltenwort/events{/privacy}","received_events_url":"https://api.github.com/users/weltenwort/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weltenwort/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":true,"url":"https://api.github.com/repos/weltenwort/kibana","forks_url":"https://api.github.com/repos/weltenwort/kibana/forks","keys_url":"https://api.github.com/repos/weltenwort/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weltenwort/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weltenwort/kibana/teams","hooks_url":"https://api.github.com/repos/weltenwort/kibana/hooks","issue_events_url":"https://api.github.com/repos/weltenwort/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/weltenwort/kibana/events","assignees_url":"https://api.github.com/repos/weltenwort/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/weltenwort/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/weltenwort/kibana/tags","blobs_url":"https://api.github.com/repos/weltenwort/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weltenwort/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weltenwort/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/weltenwort/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weltenwort/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/weltenwort/kibana/languages","stargazers_url":"https://api.github.com/repos/weltenwort/kibana/stargazers","contributors_url":"https://api.github.com/repos/weltenwort/kibana/contributors","subscribers_url":"https://api.github.com/repos/weltenwort/kibana/subscribers","subscription_url":"https://api.github.com/repos/weltenwort/kibana/subscription","commits_url":"https://api.github.com/repos/weltenwort/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/weltenwort/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/weltenwort/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/weltenwort/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/weltenwort/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/weltenwort/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weltenwort/kibana/merges","archive_url":"https://api.github.com/repos/weltenwort/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weltenwort/kibana/downloads","issues_url":"https://api.github.com/repos/weltenwort/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/weltenwort/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/weltenwort/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/weltenwort/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weltenwort/kibana/labels{/name}","releases_url":"https://api.github.com/repos/weltenwort/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/weltenwort/kibana/deployments","created_at":"2016-10-10T12:43:54Z","updated_at":"2016-10-10T12:44:00Z","pushed_at":"2018-08-15T20:49:44Z","git_url":"git://github.com/weltenwort/kibana.git","ssh_url":"git@github.com:weltenwort/kibana.git","clone_url":"https://github.com/weltenwort/kibana.git","svn_url":"https://github.com/weltenwort/kibana","homepage":"https://www.elastic.co/products/kibana","size":429674,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:feature-infra-ui","ref":"feature-infra-ui","sha":"554603decbc792fb40f4eab8329078a2d3093446","user":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"node_id":"MDEwOlJlcG9zaXRvcnk3ODMzMTY4","name":"kibana","full_name":"elastic/kibana","owner":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2018-08-16T08:51:15Z","pushed_at":"2018-08-16T10:52:33Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":438742,"stargazers_count":9882,"watchers_count":9882,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3853,"mirror_url":null,"archived":false,"open_issues_count":3289,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3853,"open_issues":3289,"watchers":9882,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/21706"},"html":{"href":"https://github.com/elastic/kibana/pull/21706"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/21706"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/21706/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/21706/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/21706/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/ad4f34ffa6d9a20fb8398c96119c3e519db6625f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"skh"}}