mirror of
https://github.com/yldio/copilot.git
synced 2024-11-16 00:00:06 +02:00
26 lines
639 B
JavaScript
26 lines
639 B
JavaScript
|
import { graphql } from 'react-apollo';
|
||
|
import InstancesQuery from '@graphql/Instances.gql';
|
||
|
|
||
|
export default graphql(InstancesQuery, {
|
||
|
options(props) {
|
||
|
const params = props.match.params;
|
||
|
const deploymentGroupSlug = params.deploymentGroup;
|
||
|
const serviceSlug = params.service;
|
||
|
return {
|
||
|
variables: {
|
||
|
deploymentGroupSlug,
|
||
|
serviceSlug
|
||
|
}
|
||
|
};
|
||
|
},
|
||
|
props: ({ data: { deploymentGroup, loading, error } }) => ({
|
||
|
service: deploymentGroup &&
|
||
|
deploymentGroup.services &&
|
||
|
deploymentGroup.services.length
|
||
|
? deploymentGroup.services[0]
|
||
|
: null,
|
||
|
loading,
|
||
|
error
|
||
|
})
|
||
|
});
|