2017-12-28 40 views
0

유령 앱에 아폴로 서버를 통합하려고 할 때 graphiql을 열려고하면 오류가 발생합니다. 표현형 앱을 만들고 webapp.connectHandlers과 연결하고 apollo 서버를 표현식 앱의 경로 중 하나에 배치하면 일하는 것이지만 "유성 방식"에서는 작동하지 않습니다. 사용자 개체에 대한 액세스를 얻을, 권한 부여 등이로드 나는 즉시 graphiql에서 볼유성 앱에 Apollo 통합

오류 :

Error: Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory

스택 트레이스 : at invariant (/Users/.../node_modules/graphql/jsutils/invariant.js:18:11)<br> &nbsp; &nbsp;at Object.validate (/Users/.../node_modules/graphql/validation/validate.js:59:72)<br> &nbsp; &nbsp;at doRunQuery (/Users/.../node_modules/apollo-server-core/dist/runQuery.js:88:38)<br> &nbsp; &nbsp;at /Users/.../node_modules/apollo-server-core/dist/runQuery.js:22:54<br> &nbsp; &nbsp;at /Users/.../.meteor/packages/promise/.0.10.0.borizy.o9z8++os+web.browser+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40

서버 코드 :

,
import {makeExecutableSchema} from 'graphql-tools'; 
import {typeDefs} from './schema'; 
import {resolvers} from './resolvers'; 
import { createApolloServer } from 'meteor/apollo'; 

export const schema = makeExecutableSchema({ 
    typeDefs, 
    resolvers 
}); 

createApolloServer({ 
    schema 
}); 

모든 것이 합법적으로 작동하며 급히 작동하지만 유성에는 작동하지 않습니다. 그 이유는 무엇입니까? 어떻게 해결할 수 있습니까?

답변

0

meteor/apollo의 최신 버전은 최신 apollo npm 패키지로 구식입니다. https://github.com/Swydo/ddp-apollo가 최신이며, "유성 방법"또한

+0

DDP-아폴로에 의해 해결 될 것입니다 것은 옵션이 아니다 나는 것이기 때문에, 그 이유는 DDP-아폴로가 훨씬 이해가되지 않습니다 마이그레이션입니다 거의 동일한 것을 사용하여 끝납니다. 어쩌면 당신은 정확한 오류에 대한 생각을 가지고 있습니다. 그래서 제 실수를 일으켜서 스스로 고칠 수 있을까요? –

0

이 문제입니다 경우 node_modules 디렉토리에 설치 GraphQL의 여러 버전이되지 않도록에서 통합을 수행, 나는 유성, DDP와 모든 쓰레기로 전환 점차 싶어하기 때문에이

rm -rf node_modules/* 
npm install 
+0

중복 확인 - 여러 버전의 graphql이 없습니다. 버전이 하나 뿐이므로 원사의 결의안을 통해 여러 버전이있을지라도 하나만 사용하게되었습니다. –