Aircraft CRUD
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
import {ApolloClient, ApolloLink, HttpLink, InMemoryCache} from '@apollo/client/core'
|
||||
import {createApolloProvider} from "@vue/apollo-option";
|
||||
import { createUploadLink } from 'apollo-upload-client';
|
||||
|
||||
const httpLink = new HttpLink({
|
||||
uri: 'http://localhost:8000/graphql',
|
||||
credentials: 'include'
|
||||
})
|
||||
|
||||
const uploadLink = createUploadLink({
|
||||
uri: 'http://localhost:8000/graphql',
|
||||
credentials: 'include'
|
||||
})
|
||||
|
||||
export const apolloClient = new ApolloClient({
|
||||
link: ApolloLink.from([httpLink]),
|
||||
link: ApolloLink.from([uploadLink]),
|
||||
cache: new InMemoryCache(),
|
||||
connectToDevTools: true,
|
||||
})
|
||||
@@ -24,6 +30,7 @@ export const apolloWrapper = {
|
||||
console.error("Error during query: ", err)
|
||||
})
|
||||
},
|
||||
|
||||
mutate(mutation, variables, onUpdate = () => {}) {
|
||||
return apolloClient
|
||||
.mutate({
|
||||
|
||||
@@ -7,5 +7,6 @@ fragment aircraftFullInfo on Aircraft {
|
||||
model
|
||||
description
|
||||
manufacturer
|
||||
photoUrl
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -27,13 +27,3 @@ mutation deleteAircraft($id: Int!) {
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// export const CREATE_CAMPAIGN = gql`
|
||||
// mutation createCampaign($input: CreateCampaignMutationInput!) {
|
||||
// createCampaign(input: $input) {
|
||||
// campaign {
|
||||
// id
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// `;
|
||||
|
||||
Reference in New Issue
Block a user