Skip to content

Commit f0913e6

Browse files
committed
prefix revert for gql editor integration
1 parent 032d346 commit f0913e6

24 files changed

+227
-226
lines changed

packages/integrations/gei-stripe/schema.graphql

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
type Query{
44
products(
5-
filter: StripeProductFilter
6-
): StripeProductsPage
7-
subscriptions(
8-
filter: StripeSubscriptionFilter
9-
): [StripeSubscription!]
5+
filter: ProductFilter
6+
): ProductsPage
7+
subscriptions(
8+
filter: SubscriptionFilter
9+
): [Subscription!]
1010
}
1111

1212
type Mutation{
@@ -28,24 +28,24 @@ type Mutation{
2828
webhook: String
2929
}
3030

31-
input StripeSubscriptionFilter {
31+
input SubscriptionFilter {
3232
customerId: String
3333
}
3434

35-
type StripeSubscription {
35+
type Subscription {
3636
id: String!
3737
cancel_at_period_end: Boolean!
3838
current_period_end: Timestamp!
3939
current_period_start: Timestamp!
4040
customer: String!
4141
description: String
42-
items:[StripeItem!]!
42+
items:[Item!]!
4343
quantity: Int!
4444
start: Timestamp!
45-
status: StripeSubStatus!
45+
status: SubStatus!
4646
}
4747

48-
enum StripeSubStatus{
48+
enum SubStatus{
4949
incomplete
5050
incomplete_expired
5151
trialing
@@ -55,16 +55,16 @@ enum StripeSubStatus{
5555
unpaid
5656
}
5757

58-
type StripeItem {
58+
type Item {
5959
id: String!
6060
created: Timestamp!
6161
metadata: AnyObject
62-
price: StripePrice!
62+
price: Price!
6363
quantity: Int!
6464
subscription: String!
6565
}
6666

67-
type StripeUser{
67+
type User{
6868
stripeId: String
6969
email: String!
7070
}
@@ -73,7 +73,7 @@ input InitStripeCustomerInput{
7373
email: String!
7474
name: String
7575
phone: String
76-
address: StripeAddressInput
76+
address: AddressInput
7777
}
7878

7979
input CreateNewUserPaymentSessionPayload{
@@ -82,7 +82,7 @@ input CreateNewUserPaymentSessionPayload{
8282
"""
8383
successUrl: String!
8484
cancelUrl: String!
85-
products: [StripeProductInput!]!
85+
products: [ProductInput!]!
8686
}
8787

8888
input CreatePaymentSessionPayload{
@@ -92,10 +92,10 @@ input CreatePaymentSessionPayload{
9292
"""
9393
successUrl: String!
9494
cancelUrl: String!
95-
products: [StripeProductInput!]!
95+
products: [ProductInput!]!
9696
}
9797

98-
input StripeProductInput{
98+
input ProductInput{
9999
productId: String!
100100
quantity: Int!
101101
}
@@ -105,7 +105,7 @@ input CreateCustomerPortalPayload{
105105
returnUrl: String!
106106
}
107107

108-
input StripeAddressInput{
108+
input AddressInput{
109109
"""
110110
City, district, suburb, town, village, or ward.
111111
"""
@@ -132,14 +132,14 @@ input StripeAddressInput{
132132
state: String!
133133
}
134134

135-
type StripeCustomer{
135+
type Customer{
136136
customerId: String!
137137
email: String!
138138
name: String
139-
address: StripeAddress
139+
address: Address
140140
}
141141

142-
type StripeAddress{
142+
type Address{
143143
city: String
144144
country: String
145145
line1: String
@@ -148,7 +148,7 @@ type StripeAddress{
148148
state: String
149149
}
150150

151-
input StripeProductFilter{
151+
input ProductFilter{
152152
active: Boolean
153153
created: TimestampFilter
154154
limit: Int
@@ -164,7 +164,7 @@ input RecurringFilter{
164164
usageType: UsageType
165165
}
166166

167-
input StripePriceFilter{
167+
input PriceFilter{
168168
active: Boolean
169169
currency: String
170170
product: ID
@@ -183,11 +183,11 @@ type Dimensions{
183183
width: Float
184184
}
185185

186-
type StripeProduct{
186+
type Product{
187187
id: ID!
188188
active: Boolean!
189189
created: Timestamp
190-
default_price: StripePrice
190+
default_price: Price
191191
description: String
192192
images: [String!]
193193
livemode: Boolean
@@ -200,7 +200,7 @@ type StripeProduct{
200200
unitLabel: String
201201
updated: Timestamp
202202
url: String
203-
prices: [StripePrice!]
203+
prices: [Price!]
204204
}
205205

206206
enum BillingScheme{
@@ -284,7 +284,7 @@ enum Type{
284284
ONE_TIME
285285
}
286286

287-
type StripePrice{
287+
type Price{
288288
id: ID!
289289
active: Boolean
290290
billing_scheme: BillingScheme
@@ -295,7 +295,7 @@ type StripePrice{
295295
lookup_key: String
296296
metadata: AnyObject
297297
nickname: String
298-
product: StripeProduct
298+
product: Product
299299
recurring: PriceRecurring
300300
tax_behavior: TaxBehaviour
301301
tiers_mode: TiersMode
@@ -305,8 +305,8 @@ type StripePrice{
305305
unit_amount_decimal: String
306306
}
307307

308-
type StripeProductsPage{
309-
products: [StripeProduct!]
308+
type ProductsPage{
309+
products: [Product!]
310310
startingAfter: ID
311311
endingBefore: ID
312312
}

packages/integrations/gei-stripe/src/StripeProduct/default_price.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Stripe from 'stripe';
44
import { MongoOrb } from '../db/orm.js';
55

66
export const handler = async (input: FieldResolveInput) =>
7-
resolverFor('StripeProduct','default_price',async (_, src: Stripe.Product) => {
7+
resolverFor('Product','default_price',async (_, src: Stripe.Product) => {
88
if (typeof src.default_price === "string") {
99
return await MongoOrb('StripePriceCollection').collection.findOne({ id: src.default_price });
1010
} else {

packages/integrations/gei-stripe/src/StripeProduct/prices.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Stripe from 'stripe';
44
import { MongoOrb } from '../db/orm.js';
55

66
export const handler = async (input: FieldResolveInput) =>
7-
resolverFor('StripeProduct','prices', async (_, src: Stripe.Product) => {
7+
resolverFor('Product','prices', async (_, src: Stripe.Product) => {
88
const cursor = MongoOrb('StripePriceCollection').collection.find({ product: src.id });
99
const prices = await cursor.toArray();
1010
return prices;

packages/integrations/gei-stripe/src/db/orm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { iGraphQL } from 'i-graphql';
22
import { ObjectId } from 'mongodb';
33
import Stripe from 'stripe';
4-
import { StripeUserModel } from '../models/StripeUserModel';
4+
import { UserModel } from '../models/UserModel';
55

66
export const orm = async () => {
77
return iGraphQL<
@@ -13,7 +13,7 @@ export const orm = async () => {
1313
StripePaymentIntentCollection: Stripe.PaymentIntent,
1414
StripeTaxRateCollection: Stripe.TaxRate,
1515
StripeInvoiceCollection: Stripe.Invoice,
16-
UserCollection: StripeUserModel
16+
UserCollection: UserModel
1717
StripeCustomerCollection: Stripe.Customer
1818
},
1919
{

packages/integrations/gei-stripe/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const integration = NewIntegration({
4949
handler: webhookHandler,
5050
}
5151
},
52-
StripeProduct: {
52+
Product: {
5353
default_price: {
5454
name: 'default_price',
5555
description: 'Resolver for querying default price object',
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ModelTypes } from '../zeus/index.js';
2+
3+
export type AddressModel = ModelTypes['Address'];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ModelTypes } from '../zeus/index.js';
2+
3+
export type CustomerModel = ModelTypes['Customer'];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ModelTypes } from '../zeus/index.js';
2+
3+
export type ItemModel = ModelTypes['Item'];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ModelTypes } from '../zeus/index.js';
2+
3+
export type PriceModel = ModelTypes['Price'];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ModelTypes } from '../zeus/index.js';
2+
3+
export type ProductModel = ModelTypes['Product'];

0 commit comments

Comments
 (0)