65 lines
1.2 KiB
TypeScript
65 lines
1.2 KiB
TypeScript
import { GraphQLJSONObject } from './scalars.js';
|
|
import { createVoiceExperience } from './voice-experiences.js';
|
|
|
|
export const schema = /* GraphQL */ `
|
|
scalar JSON
|
|
|
|
enum VoiceExperienceStatus {
|
|
UPLOADED
|
|
TRANSCRIBING
|
|
TRANSCRIBED
|
|
ANALYZING
|
|
ANALYZED
|
|
FAILED
|
|
}
|
|
|
|
type Place {
|
|
id: ID!
|
|
googlePlaceId: String!
|
|
name: String!
|
|
latitude: Float!
|
|
longitude: Float!
|
|
}
|
|
|
|
type VoiceExperience {
|
|
id: ID!
|
|
place: Place!
|
|
status: VoiceExperienceStatus!
|
|
durationSeconds: Int!
|
|
audioObjectKey: String!
|
|
transcript: String
|
|
analysis: JSON
|
|
createdAt: String!
|
|
}
|
|
|
|
input CreateVoiceExperienceInput {
|
|
googlePlaceId: String!
|
|
googleName: String!
|
|
latitude: Float!
|
|
longitude: Float!
|
|
durationSeconds: Int!
|
|
audioObjectKey: String!
|
|
}
|
|
|
|
type Query {
|
|
health: String!
|
|
}
|
|
|
|
type Mutation {
|
|
createVoiceExperience(input: CreateVoiceExperienceInput!): VoiceExperience!
|
|
}
|
|
`;
|
|
|
|
export const resolvers = {
|
|
JSON: GraphQLJSONObject,
|
|
Query: {
|
|
health: () => 'ok',
|
|
},
|
|
Mutation: {
|
|
createVoiceExperience: async (
|
|
_: unknown,
|
|
args: { input: Parameters<typeof createVoiceExperience>[0] },
|
|
) => createVoiceExperience(args.input),
|
|
},
|
|
};
|