Initial backend service
This commit is contained in:
64
src/graphql/schema.ts
Normal file
64
src/graphql/schema.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
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),
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user