1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-15 15:50:06 +02:00
copilot/packages/cp-frontend/src/containers/service/service-gql.js

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
})
});