Comments (11)
Seems like I'll find the answer here:
https://github.com/janikvonrotz/meteor-apollo-accounts-example/blob/master/server/schema.js
Any other hints would be appreciated
from meteor-apollo-accounts.
That is an old example, now just create the User schema
from meteor-apollo-accounts.
@nicolaslopezj I do have a type User schema but meteor-apollo-accounts doesn't seem to be aware of it. Where do the two connect? The User schema is registered (I can do my own mutations on it) but createAccount() is not aware of it, and so it throws an errror with everything other than the default schema (profile: { Name: String } }
import { createApolloServer } from 'meteor/apollo';
import { makeExecutableSchema } from 'graphql-tools';
import { typeDefs, resolvers } from '/imports/api/schema';
import {loadSchema, getSchema} from 'graphql-loader'
import {initAccounts} from 'meteor/nicolaslopezj:apollo-accounts'
import cors from 'cors';
//set options
// Load all accounts related resolvers and type definitions into graphql-loader
initAccounts({});
// Load all your resolvers and type definitions into graphql-loader
loadSchema({typeDefs, resolvers});
// Gets all the resolvers and type definitions loaded in graphql-loader
const schema = makeExecutableSchema(getSchema());
//create server
createApolloServer({ schema }, {
configServer: graphQLServer => graphQLServer.use(cors()),
});
from meteor-apollo-accounts.
Can you show me the error?
from meteor-apollo-accounts.
Variable "$profile" got invalid value {"cell":"42341","name":{"first":"fsadf","last":"fsfda"}}. In field "cell": Unknown field.
In graphiql my createUser mutation shows this:
username: String
email: String
password: HashedPassword
plainPassword: String
profile: CreateUserProfileInput
So somewhere along the line my schema is not getting into the packages mutations. I'm guessing that I'm missing something in my imports/startup/server/grapQL-config.js
or how I load my schemas in imports/api/schema.js
?
example here: https://github.com/acomito/spacebug-graphql.git
from meteor-apollo-accounts.
Are you defining the input CreateUserProfileInput
?
from meteor-apollo-accounts.
I have no explicitly set it. Where do you do that? Here?
//set options
const options = {
CreateUserProfileInput: `
name: Name!
`
};
// Load all accounts related resolvers and type definitions into graphql-loader
initAccounts(options);
from meteor-apollo-accounts.
Define it in your schema
input CreateUserProfileInput {
name: String!
otherField: String
}
from meteor-apollo-accounts.
ahh okay
from meteor-apollo-accounts.
That works now. What if I want to nest data I'm inserting?
type Name {
first: String
last: String
}
input CreateUserProfileInput {
name: Name
cell: String
}
from meteor-apollo-accounts.
Just define that type in other file
from meteor-apollo-accounts.
Related Issues (20)
- Remove dependency on graphql-loader HOT 4
- Accessing userId in graphql server context HOT 1
- GraphQL error: Unknown type "HashedPassword"
- Server-side Rendering & Access to user's ID
- Huge delay between when you call loginWithPassword and user object becomes available in context? react-native + apollo 2.0 HOT 1
- Disable Mutation createUser HOT 3
- Has anyone used Accounts.onCreateUser with meteor-apollo-accounts?
- RN: Crash on Android when trying to loginWithFacebook HOT 1
- Use loginWithPassword with hashPassword
- onChangeCallbacks error HOT 2
- `initAccounts` not exported from meteor/nicolaslopezj:apollo-accounts? HOT 1
- Enrollment user flow
- Float cannot represent non numeric value: {} HOT 7
- User Authentication in metoer with mysql
- Possible to not expose createUser to client? HOT 1
- Setup instructions with apollo-boost? HOT 1
- move devDependencies into devDependencies
- Checking if login token is valid HOT 2
- Looking for a mantainer HOT 3
- Client side package . How to set the fields for returning ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-apollo-accounts.