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

unable to use frappe_graphql on ERPNext 14 #90

Open
nitinfb opened this issue Apr 19, 2023 · 2 comments
Open

unable to use frappe_graphql on ERPNext 14 #90

nitinfb opened this issue Apr 19, 2023 · 2 comments

Comments

@nitinfb
Copy link

nitinfb commented Apr 19, 2023

Hi,
we are trying to use the documentation given in README.md to try to setup graphql on a fresh installation of ERPNext.

steps followed

ran docker instance from pwd.yml , then on frontend site (comes as default with pwd.yml)

(env) frappe@9c5a19b4ca7e:~/frappe-bench$ bench get --resolve-deps https://github.com/leam-tech/frappe_graphql

Following apps will be installed
1. https://github.com/leam-tech/frappe_graphql 
Getting frappe_graphql
$ git clone https://github.com/leam-tech/frappe_graphql   --origin upstream
Cloning into 'frappe_graphql'...
remote: Enumerating objects: 1207, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 1207 (delta 23), reused 17 (delta 6), pack-reused 1154
Receiving objects: 100% (1207/1207), 257.63 KiB | 641.00 KiB/s, done.
Resolving deltas: 100% (801/801), done.
Installing frappe_graphql
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe_graphql 
$ bench build --app frappe_graphql
✔ Application Assets Linked                                                                                                                                                                                 


yarn run v1.22.19
$ node esbuild --production --apps frappe_graphql --run-build-command
File                                                        Size

 DONE  Total Build Time: 613.523ms

clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
Done in 1.75s.
WARN: restart failed: Couldn't find supervisorctl in PATH

and when trying to generate sdl this happens
(env) frappe@9c5a19b4ca7e:~/frappe-bench/sites$ bench --site frontend graphql generate_sdl

Generating in Directory: /home/frappe/frappe-bench/sites/frontend/doctype_sdls
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe_graphql/frappe_graphql/commands/__init__.py", line 43, in generate_sdl
    make_doctype_sdl_files(
  File "/home/frappe/frappe-bench/apps/frappe_graphql/frappe_graphql/utils/generate_sdl/__init__.py", line 109, in make_doctype_sdl_files
    sdl = get_doctype_sdl(doctype=doctype, options=options)
  File "/home/frappe/frappe-bench/apps/frappe_graphql/frappe_graphql/utils/generate_sdl/doctype.py", line 20, in get_doctype_sdl
    sdl, defined_fieldnames = get_basic_doctype_sdl(meta, options=options, generated_enums=generated_enums)
  File "/home/frappe/frappe-bench/apps/frappe_graphql/frappe_graphql/utils/generate_sdl/doctype.py", line 70, in get_basic_doctype_sdl
    sdl += f"\n  {get_field_sdl(meta, field, options=options, generated_enums=generated_enums)}"
  File "/home/frappe/frappe-bench/apps/frappe_graphql/frappe_graphql/utils/generate_sdl/doctype.py", line 187, in get_field_sdl
    return f"{docfield.fieldname}: {get_graphql_type(meta, docfield, options=options, generated_enums=generated_enums)}"
  File "/home/frappe/frappe-bench/apps/frappe_graphql/frappe_graphql/utils/generate_sdl/doctype.py", line 239, in get_graphql_type
    frappe.throw(f"Invalid fieldtype: {docfield.fieldtype}")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 525, in throw
    msgprint(
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 493, in msgprint
    _raise_exception()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 442, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.ValidationError: Invalid fieldtype: Icon
@e-lobo
Copy link
Member

e-lobo commented Apr 19, 2023

Maybe we need to add this new field-type Icon here
I did not get a chance to play around with frappe v14 so im unaware of the new field types added.

Also you can try only generating relevant SDL's if you run into multiple errors.

@nitinfb
Copy link
Author

nitinfb commented Apr 20, 2023

That I figured out the hard way.. What frappe version should i try this plugin on ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants