Aircraft CRUD

This commit is contained in:
Michal Kváček
2023-06-05 09:55:33 +02:00
parent a3e8917db5
commit 9d843c62a6
16 changed files with 81 additions and 58 deletions
+8 -1
View File
@@ -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({
+1
View File
@@ -7,5 +7,6 @@ fragment aircraftFullInfo on Aircraft {
model
description
manufacturer
photoUrl
}
`;
-10
View File
@@ -27,13 +27,3 @@ mutation deleteAircraft($id: Int!) {
}
}
`;
// export const CREATE_CAMPAIGN = gql`
// mutation createCampaign($input: CreateCampaignMutationInput!) {
// createCampaign(input: $input) {
// campaign {
// id
// }
// }
// }
// `;