isEmailFree to isEmailUsed
This commit is contained in:
parent
a0b16edb75
commit
12679808cf
|
@ -1,4 +1,4 @@
|
||||||
from resolvers.auth import login, sign_out, is_email_free, register, confirm
|
from resolvers.auth import login, sign_out, is_email_used, register, confirm
|
||||||
from resolvers.zine import create_shout, get_shout_by_slug, \
|
from resolvers.zine import create_shout, get_shout_by_slug, \
|
||||||
top_month, top_overall, recent_published, recent_all, top_viewed, \
|
top_month, top_overall, recent_published, recent_all, top_viewed, \
|
||||||
shouts_by_authors, shouts_by_topics, shouts_by_communities, \
|
shouts_by_authors, shouts_by_topics, shouts_by_communities, \
|
||||||
|
@ -12,7 +12,7 @@ from resolvers.community import create_community, delete_community, get_communit
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"login",
|
"login",
|
||||||
"register",
|
"register",
|
||||||
"is_email_free",
|
"is_email_used",
|
||||||
"confirm",
|
"confirm",
|
||||||
# TODO: "reset_password_code",
|
# TODO: "reset_password_code",
|
||||||
# TODO: "reset_password_confirm",
|
# TODO: "reset_password_confirm",
|
||||||
|
|
|
@ -122,8 +122,8 @@ async def sign_out(_, info: GraphQLResolveInfo):
|
||||||
status = await Authorize.revoke(token)
|
status = await Authorize.revoke(token)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@query.field("isEmailFree")
|
@query.field("isEmailUsed")
|
||||||
async def is_email_free(_, info, email):
|
async def is_email_used(_, info, email):
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
user = session.query(User).filter(User.email == email).first()
|
user = session.query(User).filter(User.email == email).first()
|
||||||
return user is None
|
return not user is None
|
||||||
|
|
|
@ -143,7 +143,7 @@ type Mutation {
|
||||||
|
|
||||||
type Query {
|
type Query {
|
||||||
# auth
|
# auth
|
||||||
isEmailFree(email: String!): Boolean!
|
isEmailUsed(email: String!): Boolean!
|
||||||
signIn(email: String!, password: String): AuthResult!
|
signIn(email: String!, password: String): AuthResult!
|
||||||
signOut: Result!
|
signOut: Result!
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user