-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
I'm getting a bunch of errors when I try to use queries with variables.
// app/mirage/server.js
import { createServer } from "miragejs"
import { createGraphQLHandler } from "@miragejs/graphql"
import graphQLSchema from "app/gql/schema.gql"
export function makeServer() {
return createServer({
routes() {
const graphQLHandler = createGraphQLHandler(graphQLSchema, this.schema);
this.post("/graphql", graphQLHandler)
}
})
}// schema
import { gql } from 'glimmer-apollo'
export const graphQLSchema = gql`
type CurrentAccount {
id: ID!
name: String!
flags: [String]!
memberships: [Membership]
}
type Account {
id: ID!
accountType: String!
isActive: Boolean!
name: String!
}
type CurrentUser {
id: ID!
name: String!
email: String!
imageUrl: String!
phone: String!
isPeekAdmin: Boolean!
currentAccountRoles: [String]
accounts: [Account]
}
type Membership {
id: ID!
name: String!
membershipVariants: [MembershipVariant!]!
}
type MembershipVariant {
colorHex: String!
creditsPerTerm: Int!
description: String!
externalName: String!
id: ID!
imageUrl: String!
internalName: String!
}
type Query {
currentAccount: CurrentAccount!
currentUser: CurrentUser!
memberships(id: ID!): [Membership!]!
}
`// query
query CurrentAccountMembershipVariant($membershipId: ID, $variantId: ID) {
currentAccount {
id
memberships(id: $membershipId) {
id
membershipVariants(id: $variantId) {
id
internalName
externalName
description
currency
creditsPerTerm
imageUrl
colorHex
validBetween
validFor {
amount
unit
}
creditWindow {
unit
amount
}
}
}
}
}
Could you please give some help here @jneurock I might be missing something?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
