Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntrospectionQuery fails on local server #137

Closed
cipriancaba opened this issue May 11, 2023 · 3 comments · Fixed by #147
Closed

IntrospectionQuery fails on local server #137

cipriancaba opened this issue May 11, 2023 · 3 comments · Fixed by #147
Labels
is: bug Something isn't working is: investigating Something isn't working package: server Server package

Comments

@cipriancaba
Copy link
Contributor

This is causing issues when trying to use codegen against local server schema

@maoosi maoosi added the is: investigating Something isn't working label May 18, 2023
@maoosi
Copy link
Owner

maoosi commented May 20, 2023

I've tested a few things on my end, but couldn't find any introspection issue with the local dev server - would you have more details to share?

@maoosi maoosi added is: waiting for details Not enough information package: server Server package and removed is: investigating Something isn't working labels May 20, 2023
@cipriancaba
Copy link
Contributor Author

Here are the details. This happens while running codegen. Attaching codegen config as well

{
   "parentTypeName":"Query",
   "fieldName":"__schema",
   "variables":{
      
   },
   "selectionSetList":[
      "__typename",
      "queryType/name",
      "mutationType/name",
      "subscriptionType/name",
      "types/FullType",
      "directives/name",
      "directives/description",
      "directives/locations",
      "directives/args/InputValue"
   ],
   "selectionSetGraphQL":"query IntrospectionQuery {\n  __schema {\n    queryType {\n      name\n    }\n    mutationType {\n      name\n    }\n    subscriptionType {\n      name\n    }\n    types {\n      ...FullType\n    }\n    directives {\n      name\n      description\n      locations\n      args {\n        ...InputValue\n      }\n    }\n  }\n}\n\nfragment FullType on __Type {\n  kind\n  name\n  description\n  fields(includeDeprecated: true) {\n    name\n    description\n    args {\n      ...InputValue\n    }\n    type {\n      ...TypeRef\n    }\n    isDeprecated\n    deprecationReason\n  }\n  inputFields {\n    ...InputValue\n  }\n  interfaces {\n    ...TypeRef\n  }\n  enumValues(includeDeprecated: true) {\n    name\n    description\n    isDeprecated\n    deprecationReason\n  }\n  possibleTypes {\n    ...TypeRef\n  }\n}\n\nfragment InputValue on __InputValue {\n  name\n  description\n  type {\n    ...TypeRef\n  }\n  defaultValue\n}\n\nfragment TypeRef on __Type {\n  kind\n  name\n  ofType {\n    kind\n    name\n    ofType {\n      kind\n      name\n      ofType {\n        kind\n        name\n        ofType {\n          kind\n          name\n          ofType {\n            kind\n            name\n            ofType {\n              kind\n              name\n              ofType {\n                kind\n                name\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n"
}{
   "timestamp":"2023-05-20T07:13:23.608Z"
}

And the logs

[dev:public] ◭ 5/20/2023, 10:13:23 AM <<ERROR>> Error parsing 'action' from input event. If you are trying to query a custom resolver, make sure it is properly declared inside 'prismaAppSync.resolve({ event, resolvers: { /* HERE */ } })'.
[dev:public] {
[dev:public]   error: "Error parsing 'action' from input event. If you are trying to query a custom resolver, make sure it is properly declared inside 'prismaAppSync.resolve({ event, resolvers: { /* HERE */ } })'.",
[dev:public]   type: 'INTERNAL_SERVER_ERROR',
[dev:public]   code: 500
[dev:public] }

codegen.ts

import { CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
  overwrite: true,
  schema: {
    'http://localhost:4000/graphql',
  },
  documents: ['./graphql/apiClient.graphql'], // random query
  ignoreNoDocuments: false, // for better experience with the watcher
  verbose: true,
  debug: true,
  config: {
    sort: false,
    skipTypename: true,
    scalars: {
      AWSDateTime: 'any',
      AWSEmail: 'any',
      AWSJSON: 'any',
      AWSURL: 'any',
    },
  },
  emitLegacyCommonJSImports: false,
  generates: {
    './src/api/apiClient.ts': {
      // preset: 'client',
      plugins: [
        'typescript',
        'typescript-operations',
        'typescript-graphql-request',
      ],
      config: {
        preResolveTypes: true,
        onlyOperationTypes: true,
        skipTypeNameForRoot: true,
        skipTypename: true,
        avoidOptionals: false,
        autogenSWRKey: true,
        ignoreEnumValuesFromSchema: false,
        inlineFragmentTypes: 'combine',
        allowEnumStringTypes: true,
        enumsAsTypes: true,
        pureMagicComment: true,
        documentMode: 'graphQLTag',
      },
    },
  },
}

export default config

It fails on the first call when it's trying to fetch the schema

@maoosi maoosi added is: investigating Something isn't working is: bug Something isn't working and removed is: waiting for details Not enough information labels May 20, 2023
@maoosi maoosi linked a pull request Jun 10, 2023 that will close this issue
@maoosi
Copy link
Owner

maoosi commented Jun 10, 2023

Will be released as part of 1.0.0-rc.7.

@maoosi maoosi closed this as completed Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: bug Something isn't working is: investigating Something isn't working package: server Server package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants