profile
viewpoint
Ankit Tiwari anku255 India https://anku.netlify.com A CSE undergraduate from IIIT Kalyani, who loves working with JavaScript and open source.

anku255/ColtSteele_WebDeveloperBootcamp 17

This repository contains projects and exercises of the course "The Web Developer Boot camp by Colt Steele" at Udemy

anku255/executely 2

Execute handwritten code in your browser.

anku255/anku255.github.io 1

A static blog built using Jekyll.

anku255/1x.engineer 0

The official website of 1x Engineers around the world

anku255/2013-OOProgrammingWithJava-PART1-PART-2 0

This repository contains solution for 2013-OOProgrammingWithJava-PART1 & PART 2 projects.

anku255/awesome-developer-streams 0

👩🏿‍💻👨🏾‍💻👩🏼‍💻👨🏽‍💻👩🏻‍💻 Awesome Developers, Streaming

anku255/awesome-interview-questions 0

A Repository consisting of all the Questions asked in Interviews.

anku255/Building-Application-with-React-and-Flux 0

This repository contains all my coursework for the Pluralsight course Building Application with React and Flux

anku255/carbon 0

🎨 Create and share beautiful images of your source code

PR opened howtographql/howtographql

fix to quiz correct answer

I believe HTTP header which carries token is "Authorization" rather than "Authentication", which is correct in the tutorial, but incorrectly the quiz.

+1 -1

0 comment

1 changed file

pr created time in 17 hours

issue openedhowtographql/howtographql

Request: Add course for Flutter

Hi, This is a request to add a course for Flutter. Please excuse if I requested this at wrong place.

BR, Ekansh

created time in a day

issue openedhowtographql/howtographql

Could not import 'hackernews.schema.schema' for Graphene setting 'SCHEMA'. AttributeError: module 'hackernews.schema' has no attribute 'schema'.

I intend to achieve this:

image

image

I keep getting this error above although I am following the tutorial line by line from here. I understand there is no attribute schema but then how should I correct it as till now there has been no mention of any attribute viz. schema:

https://www.howtographql.com/graphql-python/2-queries/

created time in 2 days

issue commenthowtographql/howtographql

GraphQL - Python got stuck in the tutorial

Ah, got it!

Instead of

class Query(graphene.ObjectType):
    links = graphene.List(LinkType)
    votes = graphene.**List**(VoteType)

I typed

class Query(graphene.ObjectType):
    links = graphene.List(LinkType)
    votes = graphene.**Vote**(VoteType)

Typo, lol

aalvarez89

comment created time in 3 days

issue commenthowtographql/howtographql

GraphQL - Python got stuck in the tutorial

I'm getting a similar error. Part 5 of the tutotial (https://www.howtographql.com/graphql-python/5-links-and-voting/)

hackernews/schema.py -

import graphene
import graphql_jwt

import links.schema
import users.schema

#get data
class Query(users.schema.Query, links.schema.Query, graphene.ObjectType):
    pass

#insert data
class Mutation(users.schema.Mutation, links.schema.Mutation, graphene.ObjectType):
    token_auth = graphql_jwt.ObtainJSONWebToken.Field()
    verify_token = graphql_jwt.Verify.Field()
    refresh_token = graphql_jwt.Refresh.Field()

schema = graphene.Schema(query=Query, mutation=Mutation)

hackernews/settings.py -

"""
Django settings for hackernews project.

Generated by 'django-admin startproject' using Django 3.1.2.

For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'v&j$=al)otkf9lal*y1hk*@lh7_c(_#rf$_3q%to1+k&7*)lm('

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'graphene_django',
    'links',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
]

ROOT_URLCONF = 'hackernews.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'hackernews.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}


# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_URL = '/static/'

#my additions

GRAPHENE = {
    'SCHEMA': 'hackernews.schema.schema',
    'MIDDLEWARE': [
        'graphql_jwt.middleware.JSONWebTokenMiddleware',
    ],
}

AUTHENTICATION_BACKENDS = [
    'graphql_jwt.backends.JSONWebTokenBackend',
    'django.contrib.auth.backends.ModelBackend',
]

links/schema.py -

import graphene
from graphene_django import DjangoObjectType
from users.schema import UserType

from .models import Link, Vote

class LinkType(DjangoObjectType):
    class Meta:
        model = Link

class VoteType(DjangoObjectType):
    class Meta:
        model = Vote

class Query(graphene.ObjectType):
    links = graphene.List(LinkType)
    votes = graphene.Vote(VoteType)

    def resolve_links(self, info, **kwargs):
        return Link.objects.all()

    def resolve_votes(self, info, **kwargs):
        return Vote.objects.all()    

class CreateLink(graphene.Mutation):
    id = graphene.Int()
    url = graphene.String()
    description = graphene.String()
    posted_by = graphene.Field(UserType)

    class Arguments:
        url = graphene.String()
        description = graphene.String()

    def mutate(self, info, url, description):
        user = info.context.user or None

        link = Link(
            url=url, 
            description=description,
            posted_by=user,
            )
        link.save()

        return CreateLink(
            id=link.id,
            url=link.url,
            description=link.description,
            posted_by=link.posted_by
        )

class CreateVote(graphene.Mutation):
    user = graphene.Field(UserType)
    link = graphene.Field(LinkType)

    class Arguments:
        link_id = graphene.Int()

    def mutate(self, info, link_id):
        user = info.context.user
        if user.is_anonymous:
            raise Exception('You must be logged in to vote!')

        link = Link.objects.filter(id=link_id).first()
        if not link:
            raise Exception('Invalid Link!')

        Vote.objects.create(
            user=user,
            link=link,
        )

        return CreateVote(user=user, link=link)

class Mutation(graphene.ObjectType):
    create_link = CreateLink.Field()
    create_vote = CreateVote.Field()

Thanks!

aalvarez89

comment created time in 3 days

PR opened howtographql/howtographql

Update 8-filtering-pagination-and-sorting.md

The Prisma Client API actually uses 'skip' and 'take' to paginate a list using limit-offset.

+1 -1

0 comment

1 changed file

pr created time in 3 days

PR opened howtographql/howtographql

Update 6-authentication.md

The correct header is actually 'Authorization'.

+1 -1

0 comment

1 changed file

pr created time in 3 days

PR opened howtographql/howtographql

Update 4-adding-a-database.md

Prisma client updated their API to use $connect() and $disconnect(). (https://www.prisma.io/docs/concepts/components/prisma-client/connection-management)

I obtained TypeError: prisma.disconnect is not a function error when running client.disconnect().

+1 -1

0 comment

1 changed file

pr created time in 3 days

issue openedhowtographql/howtographql

The video is unable to close , can we fix it ?

I can't see the docs , lol image

created time in 3 days

PR opened howtographql/howtographql

getting error after prisma deploy

slugname is not being populated in the generated prisma endpoint after running primsa deploy. https://github.com/prisma/prisma-1-cloud-feedback/issues/238

+1 -1

0 comment

1 changed file

pr created time in 5 days

PR opened howtographql/howtographql

Fix typo
+1 -1

0 comment

1 changed file

pr created time in 7 days

issue openedhowtographql/howtographql

Bug on React + Apollo Tutorial

In the first snippet of More Mutations and Updating the Store page: one of the lines is : <div className="ml1 gray f11" onClick={() => this._voteForLink()}> the _voteForLink() is not mentioned anywhere else on the page. Without this function, the whole application broke.

However, in the section of Updating the cache on the same page, the first snippet is showing the correct one: <div className="ml1 gray f11" onClick={voteMutation}> same as the code in the GitHub repo for this tutorial section.

So, I think only the first snippet on the page needs to be fixed.

created time in 7 days

PR opened howtographql/howtographql

Small typo fix
+1 -1

0 comment

1 changed file

pr created time in 8 days

issue openedhowtographql/howtographql

graphene-python: Answer wrong for, In which Python class is defined the arguments for a Mutation?

As far as I have learned, the arguments for a mutation are defined in the Arguments subclass of Mutation class. But, the quiz says the correct answer is Input. Please correct. Screenshot

created time in 11 days

PR opened howtographql/howtographql

fix: js code highlight coverage

The JavaScript code highlight coverage before does not count blank lines and comments. So the coverage become weird. This commit fixes coverage so that readers can easily distinguish which part of the codes are replaced.

+1 -1

0 comment

1 changed file

pr created time in 13 days

CommitCommentEvent

PR closed howtographql/howtographql

Update 4-adding-a-database.md

Fix typo in schema filename.

+1 -1

0 comment

1 changed file

ankitshaw42

pr closed time in 13 days

issue closedhowtographql/howtographql

unable to run query (react-apollo loading links)

from this topic, https://github.com/howtographql/howtographql/blob/master/content/frontend/react-apollo/2-queries-loading-links.md

when I try to run this query in the playground (after prisma was deployed and server started),

{
  feed {
    links {
      id
      createdAt
      description
      url
    }
  }
}

I'm getting this error back

{
  "data": null,
  "errors": [
    {
      "message": "Only absolute URLs are supported",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "feed"
      ]
    }
  ]
}

I believe the server was set up without issues. would this mean there are out of date dependencies? thanks.

closed time in 14 days

cch5ng

issue commenthowtographql/howtographql

unable to run query (react-apollo loading links)

sorry. I made an error and had not completed all the steps in the prisma deployment. the queries are being run as expected currently.

cch5ng

comment created time in 14 days

issue openedhowtographql/howtographql

unable to run query (react-apollo loading links)

from this topic, https://github.com/howtographql/howtographql/blob/master/content/frontend/react-apollo/2-queries-loading-links.md

when I try to run this query in the playground (after prisma was deployed and server started),

{
  feed {
    links {
      id
      createdAt
      description
      url
    }
  }
}

I'm getting this error back

{
  "data": null,
  "errors": [
    {
      "message": "Only absolute URLs are supported",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "feed"
      ]
    }
  ]
}

I believe the server was set up without issues. would this mean there are out of date dependencies? thanks.

created time in 14 days

CommitCommentEvent

pull request commentanku255/quotic-client

Add .gitpod.yml

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/anku/quotic-client/9g3ezyiuv
✅ Preview: In Progress

anku255

comment created time in 15 days

CommitCommentEvent

pull request commentanku255/quotic-client

:bug: Update show page URL

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/anku/quotic-client/7j1l8s99c
✅ Preview: https://quotic-client-git-fix-show-page-url.anku.vercel.app

anku255

comment created time in 15 days

PR closed howtographql/howtographql

Fixed incorrect answer on quiz

Q. Which HTTP header field carries the authentication token?

The correct answer is Authorization not Authentication

ps. This is an amazing guide! Thanks for creating it. :)

+1 -1

1 comment

1 changed file

jaymcguinness

pr closed time in 15 days

pull request commenthowtographql/howtographql

Fixed incorrect answer on quiz

Dupe of #1162 - closing

jaymcguinness

comment created time in 15 days

PR opened howtographql/howtographql

Fixed incorrect answer on quiz

Q. Which HTTP header field carries the authentication token?

The correct answer is Authorization not Authentication

ps. This is an amazing guide! Thanks for creating it. :)

+1 -1

0 comment

1 changed file

pr created time in 15 days

PR closed howtographql/howtographql

Fix correct answer on JS tutorial chapter 6

Correct answer is 2 Authorization.

+1 -1

1 comment

1 changed file

Charca

pr closed time in 16 days

more