Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/packages / customize / __docs / Graphql12.js
Size: Mime:
import { gql } from 'apollo-boost';
import { GraphQLModule, mergeGraphQLSchemas } from '@skava/graphql-toolset';
import { userModule } from '@skava/graphql/dist/graphql-modules/store';
import { Request } from '@skava/request';
import { StoreModel, StoreSchema } from '@skava/graphql/dist/graphql-modules/store';
const storeModule = new GraphQLModule({
    name: 'Store',
    typeDefs: mergeGraphQLSchemas([
        gql `
      type Query {
        storeLocator(latitude: Float, longitude: Float): StoreLocatorResponse
      }
    `,
        StoreModel,
        StoreSchema,
    ]),
    dataSources: () => endpoints,
    contextBuilder: () => {
        return {
            getStore: new Request().get().url('https://ulta.skava.com/orchestration'),
        },
        ;
    },
    resolvers: [
        {
            Query: {
                stores: (root, args, context) => {
                    const response = await context.getStore.doRequest();
                    // could do a transform here
                    return response.data;
                },
            },
        },
    ],
});
export const appModules = new GraphQLModule({
    name: 'App',
    imports: [
        storeModule,
        // ...
        userModule,
    ],
});
//# sourceMappingURL=Graphql12.js.map